--- a/lib/bind9/Makefile.in
+++ b/lib/bind9/Makefile.in
@@ -33,7 +33,7 @@
 ISCCFGDEPLIBS =	../../lib/isccfg/libisccfg.@A@
 DNSDEPLIBS =    ../../lib/dns/libdns.@A@
 
-LIBS =		@LIBS@
+LIBS =		${OPENSSL_LIBS} ${LIBUV_LIBS} @LIBS@
 
 SUBDIRS =	include
 
--- a/lib/dns/Makefile.in
+++ b/lib/dns/Makefile.in
@@ -42,7 +42,7 @@
 
 ISCDEPLIBS =	../../lib/isc/libisc.@A@
 
-LIBS =		${FSTRM_LIBS} ${MAXMINDDB_LIBS} ${LMDB_LIBS} ${PROTOBUF_C_LIBS} @LIBS@
+LIBS =		${FSTRM_LIBS} ${MAXMINDDB_LIBS} ${LMDB_LIBS} ${PROTOBUF_C_LIBS} ${OPENSSL_LIBS} ${LIBUV_LIBS} @LIBS@
 
 # Alphabetically
 
--- a/lib/irs/Makefile.in
+++ b/lib/irs/Makefile.in
@@ -37,7 +37,7 @@
 
 ISCCFGDEPLIBS =	../../lib/isccfg/libisccfg.@A@
 
-LIBS =		@LIBS@
+LIBS =		${OPENSSL_LIBS} ${LIBUV_LIBS} @LIBS@
 
 # Alphabetically
 OBJS =		context.@O@ \
--- a/lib/isccc/Makefile.in
+++ b/lib/isccc/Makefile.in
@@ -30,7 +30,7 @@
 ISCDEPLIBS =	../../lib/isc/libisc.@A@
 ISCCCDEPLIBS =	libisccc.@A@
 
-LIBS =		@LIBS@
+LIBS =		${OPENSSL_LIBS} ${LIBUV_LIBS} @LIBS@
 
 SUBDIRS =	include
 
--- a/lib/isccfg/Makefile.in
+++ b/lib/isccfg/Makefile.in
@@ -29,7 +29,7 @@
 ISCDEPLIBS =	../../lib/isc/libisc.@A@
 ISCCFGDEPLIBS =	libisccfg.@A@
 
-LIBS =		@LIBS@
+LIBS =		${OPENSSL_LIBS} ${LIBUV_LIBS} @LIBS@
 
 SUBDIRS =	include
 TESTDIRS =	@UNITTESTS@
--- a/lib/ns/Makefile.in
+++ b/lib/ns/Makefile.in
@@ -35,7 +35,7 @@
 
 DNSDEPLIBS =	../../lib/dns/libdns.@A@
 
-LIBS =		@LIBS@
+LIBS =		${OPENSSL_LIBS} ${LIBUV_LIBS} @LIBS@
 
 # Alphabetically
 OBJS =		client.@O@ hooks.@O@ interfacemgr.@O@ lib.@O@ \
