Do not overwrite CXXFLAGS with CFLAGS.
--- configure.orig	2015-05-16 02:58:18.000000000 -0500
+++ configure	2022-01-12 18:54:52.000000000 -0600
@@ -11549,7 +11549,7 @@
 
 if test "x$enable_debug" != "xno"; then :
 
-          CXXFLAGS="$CFLAGS -g -DDEBUG"
+          CXXFLAGS="$CXXFLAGS -g -DDEBUG"
           enable_debug="yes"
 
 fi
