diff -up OpenBLAS-0.3.21/Makefile.fixtests OpenBLAS-0.3.21/Makefile
--- OpenBLAS-0.3.21/Makefile.fixtests	2022-08-26 07:37:06.257272957 +0200
+++ OpenBLAS-0.3.21/Makefile	2022-08-26 07:37:53.168414307 +0200
@@ -147,18 +147,18 @@ tests :
 ifeq ($(NOFORTRAN), $(filter 0,$(NOFORTRAN)))
 	touch $(LIBNAME)
 ifndef NO_FBLAS
-	$(MAKE) -C test all
+	$(MAKE) -C test FC="$(FC)" CC="$(CC)" COMMON_OPT="$(COMMON_OPT)" FCOMMON_OPT="$(FCOMMON_OPT)" all
 endif
 endif
 ifneq ($(ONLY_CBLAS), 1)
-	$(MAKE) -C utest all
+	$(MAKE) -C utest FC="$(FC)" CC="$(CC)" COMMON_OPT="$(COMMON_OPT)" FCOMMON_OPT="$(FCOMMON_OPT)" all
 endif
 ifneq ($(NO_CBLAS), 1)
 ifneq ($(ONLY_CBLAS), 1)
-	$(MAKE) -C ctest all
+	$(MAKE) -C ctest FC="$(FC)" CC="$(CC)" COMMON_OPT="$(COMMON_OPT)" FCOMMON_OPT="$(FCOMMON_OPT)" all
 endif
 ifeq ($(CPP_THREAD_SAFETY_TEST), 1)
-	$(MAKE) -C cpp_thread_test all
+	$(MAKE) -C cpp_thread_test FC="$(FC)" CC="$(CC)" COMMON_OPT="$(COMMON_OPT)" FCOMMON_OPT="$(FCOMMON_OPT)" all
 endif
 endif
 
