Ideally we should like with -ldl for dlopen() dlclose().
diff --git a/Makefile.am b/Makefile.am
index ee007c6..fd8d239 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -27,7 +27,7 @@ cgminer_SOURCES = elist.h miner.h compat.h bench_block.h \
adl.c adl.h adl_functions.h \
phatk110817.cl poclbm110817.cl
-cgminer_LDFLAGS = $(PTHREAD_FLAGS)
+cgminer_LDFLAGS = $(PTHREAD_FLAGS) -ldl
cgminer_LDADD = @LIBCURL_LIBS@ @JANSSON_LIBS@ @PTHREAD_LIBS@ @OPENCL_LIBS@ @NCURSES_LIBS@ @PDCURSES_LIBS@ @WS2_LIBS@ lib/libgnu.a ccan/libccan.a
cgminer_CPPFLAGS = -I$(top_builddir)/lib -I$(top_srcdir)/lib