configure: Support the capturing of CFLAGS and CXXFLAGS at configure time.