--- a/src/Makefile
+++ b/src/Makefile
@@ -188,7 +188,7 @@
 ifndef NO_SRIPDLIB
 MANDATORY_CFLAGS += -std=c++11 -pedantic
 endif
-MANDATORY_LIBS += -L. -L$(PREFIX)/$(LIB) -Wl,-rpath,.
+MANDATORY_LIBS += -L. -L$(PREFIX)/$(LIB)
 ifdef IS_GCC
 MANDATORY_CFLAGS += -Wall -Wextra -Wfatal-errors -Werror=unknown-pragmas -Werror=unused-label
 GCC_VER_GTEQ5 = $(shell expr `$(CXX) -dumpversion | cut -f1 -d.` \>= 5)
--- a/gmic-qt/gmic_qt.pro
+++ b/gmic-qt/gmic_qt.pro
@@ -434,7 +434,7 @@
 
 equals(GMIC_DYNAMIC_LINKING, "on" )|equals(GMIC_DYNAMIC_LINKING, "ON" ) {
   message(Dynamic linking with libgmic)
-  LIBS += -Wl,-rpath,. $$GMIC_PATH/libgmic.so
+  LIBS += $$GMIC_PATH/libgmic.so
 }
 
 equals(GMIC_DYNAMIC_LINKING, "off" )|equals(GMIC_DYNAMIC_LINKING, "OFF" ) {
