fix handling of CFLAGS/CXXFLAGS, now using AM_CFLAGS