diff --git a/configure.ac b/configure.ac
index d7b40160de2d1f37cd1eaef1c46e2047c195b0d8..0603249e819060803de4eedada6f3371f1611d33 100644
--- a/configure.ac
+++ b/configure.ac
@@ -261,7 +261,7 @@ else
   TESTSUITE_OCTAVE="no"
 fi
 
-if test "$BUILD_DYNAREPLUSPLUS" = "yes"; then
+if test "x$ax_blas_ok" = "xyes" -a "x$ax_lapack_ok" = "xyes"; then
   TESTSUITE_DYNAREPLUSPLUS="yes"
 else
   TESTSUITE_DYNAREPLUSPLUS="no"