diff --git a/src/Makefile.am b/src/Makefile.am
index dd0abe74ce3b76452d44caa0d42f0ad0493f8828..e9dc9e0df50900009f59b5863b1fd414dd678829 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1543,6 +1543,7 @@ libvirt_driver_nwfilter_la_SOURCES =
 libvirt_driver_nwfilter_la_LIBADD = libvirt_driver_nwfilter_impl.la
 if WITH_DRIVER_MODULES
 mod_LTLIBRARIES += libvirt_driver_nwfilter.la
+libvirt_driver_nwfilter_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
 else ! WITH_DRIVER_MODULES
 noinst_LTLIBRARIES += libvirt_driver_nwfilter.la
 # Stateful, so linked to daemon instead