diff --git a/contrib/src/opendht/rules.mak b/contrib/src/opendht/rules.mak
index 1408ada875b17a55937f07bee56e7ac3e23fd924..864e0967378d7abcb3b5b16fd14dc0c631ab3fca 100644
--- a/contrib/src/opendht/rules.mak
+++ b/contrib/src/opendht/rules.mak
@@ -36,6 +36,6 @@ opendht: opendht-$(OPENDHT_VERSION).tar.gz
 
 .opendht: opendht .sum-opendht
 	mkdir -p $</m4 && $(RECONF)
-	cd $< && $(HOSTVARS) ./configure --disable-tools --disable-python --disable-doc --enable-proxy-server --enable-proxy-client --enable-push-notifications $(HOSTCONF)
+	cd $< && $(HOSTVARS) ./configure --enable-static --disable-shared --disable-tools --disable-python --disable-doc --enable-proxy-server --enable-proxy-client --enable-push-notifications $(HOSTCONF)
 	cd $< && $(MAKE) install
 	touch $@
diff --git a/src/Makefile.am b/src/Makefile.am
index aaa28d80305392973a7d71a40d03034859b0ab44..4f46170f8ecfcf23f1984aba4aa2e8411c362ddc 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -60,6 +60,8 @@ libring_la_LDFLAGS = \
 		@OPENDHT_LIBS@ \
 		@SECP256K1_LIBS@ \
 		@ZLIB_LIBS@ \
+		@LIBSSL_LIBS@ \
+		@LIBCRYPTO_LIBS@ \
 		$(PCRE_LIBS) \
 		@LIBS@