diff -Naur libgcrypt-1.5.0-old/tests/Makefile.am libgcrypt-1.5.0-new/tests/Makefile.am
--- libgcrypt-1.5.0-old/tests/Makefile.am	2011-06-11 11:56:32.000000000 -0700
+++ libgcrypt-1.5.0-new/tests/Makefile.am	2011-06-30 20:08:49.000000000 -0700
@@ -36,6 +36,7 @@
 # a built header.
 AM_CPPFLAGS = -I../src -I$(top_srcdir)/src
 AM_CFLAGS = $(GPG_ERROR_CFLAGS)
+AM_LDFLAGS = $(GPG_ERROR_LIBS)
 
 LDADD = ../src/libgcrypt.la $(DL_LIBS) ../compat/libcompat.la $(GPG_ERROR_LIBS)
 
diff -Naur libgcrypt-1.5.0-old/tests/Makefile.in libgcrypt-1.5.0-new/tests/Makefile.in
--- libgcrypt-1.5.0-old/tests/Makefile.in	2011-06-29 01:58:01.000000000 -0700
+++ libgcrypt-1.5.0-new/tests/Makefile.in	2011-06-30 20:10:01.000000000 -0700
@@ -400,6 +400,7 @@
 # a built header.
 AM_CPPFLAGS = -I../src -I$(top_srcdir)/src
 AM_CFLAGS = $(GPG_ERROR_CFLAGS)
+AM_LDFLAGS = $(GPG_ERROR_LIBS)
 LDADD = ../src/libgcrypt.la $(DL_LIBS) ../compat/libcompat.la $(GPG_ERROR_LIBS)
 EXTRA_DIST = README rsa-16k.key cavs_tests.sh cavs_driver.pl \
 	     pkcs1v2-oaep.h pkcs1v2-pss.h pkcs1v2-v15c.h pkcs1v2-v15s.h
