Replace AM_CPPFLAGS with CFLAGS
Use AC_PROG_CC_C99 to set C compiler