diff --git a/configure.ac b/configure.ac
index 5b46b18..5e0264a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -248,49 +248,24 @@ dnl echo '**********************************************************************
 dnl exit 1
 dnl ])
 
-BLAS_FOUND=false
-
-FF_CHECK_BLAS_CFLAGS
-FF_CHECK_BLAS_LIBS
-FF_CHECK_MKL
-FF_CHECK_USER_BLAS
-FF_CHECK_USER_LAPACK
-
-FF_OPENBLAS_NUM_THREADS
-
-# FF_CHECK_BLAS
-
-# FF_CHECK_GOTOBLAS
-
-# FF_CHECK_GSL
-
-# if test "$BLAS_FOUND" = "false" ; then
-	# FF_CHECK_CBLAS
-# fi
-
-# if test "$BLAS_FOUND" = "false" ; then
-	# FF_CHECK_OTHERBLAS
-# fi
-
-# FF_CHECK_LAPACK
-
-# if test "$BLAS_FOUND" = "false" ; then
-	# FF_CHECK_BLAS2
-# fi
-
-
-
-# BLAS_LIBS="${BLAS_LIBS}"
-# BLAS_LIBS="-L/${BLAS_PATH} ${LAPACK_LIBS} ${BLAS_LIBS}"
-# AC_SUBST(BLAS_LIBS)
-
-# FF_CHECK_CUDA
-
-# AM_CONDITIONAL(FFLASFFPACK_HAVE_BLAS,  test "x$BLAS_FOUND" != "xfalse")
-
-
-# FF_BENCH
-
+PKG_PROG_PKG_CONFIG
+
+PKG_CHECK_MODULES([BLAS], [cblas blas],[
+    AC_DEFINE(HAVE_BLAS,1,[Define if BLAS is installed])
+    AC_DEFINE(HAVE_CBLAS,1,[Define if C interface to BLAS is installed])
+    HAVE_BLAS=yes
+    BLAS_PATH=""
+    CBLAS_LIBS="${BLAS_LIBS}"
+    AC_SUBST(BLAS_LIBS)
+    AC_SUBST(CBLAS_LIBS)
+    AC_SUBST(BLAS_CFLAGS)
+    AC_SUBST(BLAS_PATH)])
+
+PKG_CHECK_MODULES([LAPACK], [lapack],[
+    AC_DEFINE(HAVE_LAPACK,1,[Define if LAPACK is installed])
+    AC_SUBST(LAPACK_LIBS)])
+
+AM_CONDITIONAL(FFLASFFPACK_HAVE_LAPACK,  test "x$HAVE_LAPACK" == "x1")
 
 FF_DOC
 
diff --git a/fflas-ffpack-config.in b/fflas-ffpack-config.in
index f1dac22..17633a0 100644
--- a/fflas-ffpack-config.in
+++ b/fflas-ffpack-config.in
@@ -107,11 +107,11 @@ while test $# -gt 0; do
 			;;
 
 		--libs)
-			echo @PARLIBS@ @PRECOMPILE_LIBS@ @BLAS_LIBS@ @GIVARO_LIBS@ # @CUDA_LIBS@
+			echo @PARLIBS@ @PRECOMPILE_LIBS@ @LAPACK_LIBS@ @BLAS_LIBS@ @GIVARO_LIBS@ # @CUDA_LIBS@
 			;;
 
 		--blas-libs)
-			echo  @BLAS_LIBS@
+			echo  @LAPACK_LIBS@ @BLAS_LIBS@
 			;;
 
 		--blas-home)
