diff -rup2 ../ruby-1.8.1-base/ext/extmk.rb ./ext/extmk.rb
--- ../ruby-1.8.1-base/ext/extmk.rb	Wed Dec 24 04:53:10 2003
+++ ./ext/extmk.rb	Thu Dec 25 05:39:12 2003
@@ -110,5 +110,5 @@ def extmake(target)
       $extflags += " " + $DLDFLAGS unless $DLDFLAGS.empty?
       $extflags += " " + $LDFLAGS unless $LDFLAGS.empty?
-      $extlibs |= $libs.split | $LOCAL_LIBS.split
+      $extlibs = $libs.split | $LOCAL_LIBS.split | $extlibs
       $extpath |= $LIBPATH
     end
@@ -261,4 +261,5 @@ SRC
   end
   $extpath.delete("$(topdir)")
+  $extpath.delete("$(libdir)")
   $extflags = libpathflag($extpath) << " " << $extflags.strip
   conf = [
