diff --git a/configure b/configure
index 76c8bf23afcc4f45bbd94d8df1c196cb09995745..1e103ff09790b50021417ecfc7de0b990303dba0 100755
--- a/configure
+++ b/configure
@@ -731,11 +731,7 @@ check_lib(){
     header="$1"
     func="$2"
     shift 2
-    temp_extralibs "$@"
-    check_header $header && check_func $func && add_extralibs "$@"
-    err=$?
-    restore_flags
-    return $err
+    check_header $header && check_func $func "$@" && add_extralibs "$@"
 }
 
 check_lib2(){