--- a/lib/autoconf/fortran.m4	2021-03-11 12:44:48.000000000 -0800
+++ b/lib/autoconf/fortran.m4	2021-03-11 12:45:33.000000000 -0800
@@ -511,6 +511,7 @@
 # LIBRARY_PATH; skip all such settings.
 ac_[]_AC_LANG_ABBREV[]_v_output=`eval $ac_link AS_MESSAGE_LOG_FD>&1 2>&1 |
   sed '/^Driving:/d; /^Configured with:/d;
+  s/\/.*\/lib.*\.a//p ;
       '"/^[[_$as_cr_Letters]][[_$as_cr_alnum]]*=/d"`
 AS_ECHO(["$ac_[]_AC_LANG_ABBREV[]_v_output"]) >&AS_MESSAGE_LOG_FD
 _AC_LANG_PREFIX[]FLAGS=$ac_save_[]_AC_LANG_PREFIX[]FLAGS
