--- src/Makefile.in.orig	2006-11-20 05:38:25.000000000 -0600
+++ src/Makefile.in	2011-09-19 15:33:25.000000000 -0500
@@ -17,6 +17,7 @@
 STRIP = @STRIP@
 CFLAGS = @CFLAGS@ -I.. -I$(top_srcdir) @DEFS@ $(CFLGS)
 CPPFLAGS = @CPPFLAGS@
+LDFLAGS = @LDFLAGS@
 
 eggdrop_objs = bg.o botcmd.o botmsg.o botnet.o chanprog.o cmds.o dcc.o \
 dccutil.o dns.o flags.o language.o match.o main.o mem.o misc.o misc_file.o \
@@ -37,7 +38,7 @@
 	@echo "Linking eggdrop $(EGGBUILD)."
 	@echo ""
 	@touch mod/mod.xlibs
-	$(LD) -o ../$(EGGEXEC) $(eggdrop_objs) $(MODOBJS) $(XLIBS) md5/md5c.o compat/*.o `cat mod/mod.xlibs`
+	$(LD) $(LDFLAGS) -o ../$(EGGEXEC) $(eggdrop_objs) $(MODOBJS) $(XLIBS) md5/md5c.o compat/*.o `cat mod/mod.xlibs`
 	$(STRIP) ../$(EGGEXEC)
 	@echo ""
 	@echo "Successful compile: $(EGGEXEC)"
@@ -59,7 +60,7 @@
 main.o:
 	$(CC) $(CFLAGS) $(CPPFLAGS) \
 '-DCCFLAGS="$(CC) $(CFLAGS) $(CPPFLAGS)"' \
-'-DLDFLAGS="$(LD)"' \
+'-DLDFLAGS="$(LD) $(LDFLAGS)"' \
 '-DSTRIPFLAGS="$(STRIP)"' -c $(srcdir)/main.c
 
 compatability:
