The default C++ flags for debug/optimization settings to the configure script should be CXXFLAGS, not CPPFLAGS which is used for pre-processing.
Fixed in commit 7226237468f5e13e4cbea73ece2108ec49c00ed1