--- config/rules.mk.orig	2006-05-06 19:28:46.000000000 +0200
+++ config/rules.mk	2006-05-06 19:28:53.000000000 +0200
@@ -44,7 +44,7 @@
 	$(RANLIB) $@
 
 %.so:
-	$(LINK.cc) $(SHARED) $^ -o $@
+	$(LINK.cc) $(SHARED) $^ $(LDLIBS) -o $@
 
 %.dll:
 	$(LINK.cc) $(SHARED) $^ -o $@
--- xplc/vars.mk.orig	2006-05-06 19:32:06.000000000 +0200
+++ xplc/vars.mk	2006-05-06 19:32:12.000000000 +0200
@@ -32,7 +32,7 @@
 
 ifneq ("$(enable_loader)", "no")
 ifneq ("$(with_dlopen)", "no")
-libxplc.so: LDFLAGS+=$(with_dlopen)
+libxplc.so: LDLIBS+=$(with_dlopen)
 endif
 endif
 
