fix CPPFLAGS handling in configure.ac, closes #674