Consistently use AM_CPPFLAGS, not AM_CFLAGS, for -D and -I options.