--- Makefile.in.orig	2007-05-19 21:32:14.000000000 +0200
+++ Makefile.in	2014-01-08 23:22:47.000000000 +0100
@@ -458,13 +458,15 @@
 
 staticLDFLAGS = # @LDFLAGS_STATIC@ # @LDFLAGS_NPTL@
 myLDFLAGS = @WITH_LIBELF_LIB@ @WITH_BEECRYPT_LIB@
-myLDADD = \
+myLDADD_la = \
 	$(top_builddir)/lib/librpm.la \
 	$(top_builddir)/rpmdb/librpmdb.la \
 	$(top_builddir)/rpmio/librpmio.la \
-	@WITH_POPT_LIB@ \
 	@WITH_ZLIB_LIB@ \
+	
+myLDADD = $(myLDADD_la) \
+	@WITH_POPT_LIB@ \
 	@LIBMISC@
 
 rpmbindir = `echo $(bindir) | sed -e s,usr/bin,bin,`
 bin_SCRIPTS = gendiff
@@ -1160,7 +1161,7 @@
 rpmq.o:	$(top_srcdir)/rpmqv.c
 	$(COMPILE) -fpie -DIAM_RPMQV -o $@ -c $<
 
-$(PROGRAMS): 		$(myLDADD) @WITH_APIDOCS_TARGET@
+$(PROGRAMS): 		$(myLDADD_la) @WITH_APIDOCS_TARGET@
 
 .PHONY:	splint
 splint:
