--- NetworkManager-openvpn-1.2.4/configure.ac.orig	2016-08-12 10:25:07.404430045 +0200
+++ NetworkManager-openvpn-1.2.4/configure.ac	2016-08-12 10:25:16.846396578 +0200
@@ -38,6 +38,9 @@
 AC_PROG_GCC_TRADITIONAL
 AC_FUNC_MEMCMP
 AC_CHECK_FUNCS(select socket uname)
+AC_SEARCH_LIBS([dlopen], [dl dld], [], [
+  AC_MSG_ERROR([unable to find the dlopen() function])
+])
 
 dnl ensure that when the Automake generated makefile calls aclocal,
 dnl it honours the $ACLOCAL_FLAGS environment variable
--- NetworkManager-openvpn-1.2.4/properties/tests/Makefile.am.orig	2016-08-12 10:38:52.809726092 +0200
+++ NetworkManager-openvpn-1.2.4/properties/tests/Makefile.am	2016-08-12 10:38:18.426219539 +0200
@@ -27,7 +27,7 @@
 	$(GTK_LIBS) \
 	$(LIBNM_LIBS) \
 	$(LIBNMA_LIBS) \
-	-ldl \
+	$(DLOPEN_LIBS) \
 	$(top_builddir)/properties/libnm-vpn-plugin-openvpn-test.la
 
 
@@ -46,6 +46,7 @@
 	$(GTK_LIBS) \
 	$(LIBNM_GLIB_LIBS) \
 	$(LIBNM_GTK_LIBS) \
+	$(DLOPEN_LIBS) \
 	$(top_builddir)/properties/libnm-openvpn-properties-test.la
 
 
