make sure -O3 is used when compiling with CFLAGS, fix #1418