fix order of CPPFLAGS and CFLAGS, make CFLAGS assignment more flexible