--- a/src/qtgui/recoll.pro
+++ b/src/qtgui/recoll.pro
@@ -27,7 +27,7 @@
   MOC_DIR = .moc
   OBJECTS_DIR = .obj
   LIBS += ../lib/librcl.a ../bincimapmime/libmime.a \
-          -L/usr/local/lib -lxapian -liconv \
+            $(BSTATIC) -L/usr/local/lib -lxapian -liconv $(BDYNAMIC) \
            -lz
   INCLUDEPATH += ../common ../index ../query ../unac ../utils