See https://bugs.gentoo.org/show_bug.cgi?id=235610

--- config/configure.in
+++ config/configure.in
@@ -53,7 +53,7 @@
 esac
 # On PPC64 libosp is to be found in /usr/lib64; thus
 # fall back to this directory
-test -d ${osplibdir}64 && osplibdir=${osplibdir}64
+test -f ${osplibdir}64/libosp.la && osplibdir=${osplibdir}64
 AC_MSG_CHECKING(location of OpenSP Library)
 AC_ARG_ENABLE(splibdir,
 [  --enable-splibdir=pathlist
--- configure
+++ configure
@@ -1753,7 +1753,7 @@
 esac
 # On PPC64 libosp is to be found in /usr/lib64; thus
 # fall back to this directory
-test -d ${osplibdir}64 && osplibdir=${osplibdir}64
+test -f ${osplibdir}64/libosp.la && osplibdir=${osplibdir}64
 echo "$as_me:$LINENO: checking location of OpenSP Library" >&5
 echo $ECHO_N "checking location of OpenSP Library... $ECHO_C" >&6
 # Check whether --enable-splibdir or --disable-splibdir was given.
