diff --git a/configure b/configure
index 1c240691eb38c3178d5798c6148a95e64a331a22..57d152d3e4afe800163c1a734454aeae1bc52838 100755
--- a/configure
+++ b/configure
@@ -241,19 +241,19 @@ check_library() {
     for i in $libdirs ; do
         # look first in the lib32 directories
         if test "x$checklib32" = "xyes" ; then
-            i32=`echo $i | sed 's|lib*|lib32|'`
+            i32=`echo $i | sed 's|lib|lib32|'`
             #i="$i32 $i"
             i="$i32"
         fi
         # look first in the lib64 directories
         if test "x$checklib64" = "xyes" ; then
-            i64=`echo $i | sed 's|lib*|lib64|'`
+            i64=`echo $i | sed 's|lib|lib64|'`
             #i="$i64 $i"
             i="$i64"
         fi
         # look first in the hpux64 directories
         if test "x$checkhpux64" = "xyes" ; then
-            i64=`echo $i | sed 's|\(lib*\)|\1/hpux64|'`
+            i64=`echo $i | sed 's|\(lib\)|\1/hpux64|'`
             #i="$i64 $i"
             i="$i64"
         fi