bpo-35351: Pass link time optimization flags to CFLAGS_NODIST (GH-10797)

When using link time optimizations, the -flto flag is passed to
BASECFLAGS, which makes it propagate to distutils. Those flags
should be reserved for the interpreter and the stdlib extension
modules only, thus moving those flags to CFLAGS_NODIST.
diff --git a/configure b/configure
index e9e33b3..8d33363 100755
--- a/configure
+++ b/configure
@@ -6626,7 +6626,7 @@
       LTOFLAGS="$LTOFLAGS -g"
   fi
 
-  BASECFLAGS="$BASECFLAGS $LTOFLAGS"
+  CFLAGS_NODIST="$CFLAGS_NODIST $LTOFLAGS"
   LDFLAGS="$LDFLAGS $LTOFLAGS"
 fi