--- a/m4/ssl.m4
+++ b/m4/ssl.m4
@@ -10,7 +10,6 @@
 		old_CPPFLAGS="$CPPFLAGS"
 		LIBS="$LIBS -lssl -lcrypto"
 		if test $loc != default; then
-			LDFLAGS="$LDFLAGS -L$loc/lib"
 			CPPFLAGS="$CPPFLAGS -I$loc/include"
 		fi
 		AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <openssl/ssl.h>
@@ -21,7 +20,6 @@
 		if test $found_loc != "none"; then
 			lftp_cv_openssl="OPENSSL_LIBS=\"-lssl -lcrypto\""
 			if test $found_loc != default; then
-				lftp_cv_openssl="$lftp_cv_openssl OPENSSL_LDFLAGS=\"-L$found_loc/lib -R$found_loc/lib\""
 				lftp_cv_openssl="$lftp_cv_openssl OPENSSL_CPPFLAGS=-I$found_loc/include"
 			fi
 			break;
