diff --git a/common.mak b/common.mak
index 2748e5ed466b372caf2010e68cc4cf2bb5afe119..0c08a59388a21fda5516ff2b58fd8c561f77878d 100644
--- a/common.mak
+++ b/common.mak
@@ -86,9 +86,9 @@ uninstall-libs:
 ifeq ($(CONFIG_MINGW),yes)
 	-rm -f $(prefix)/$(SLIBNAME)
 else
-	-rm -f $(libdir)/$(SLIBNAME_WITH_MAJOR) \
-	       $(libdir)/$(SLIBNAME)            \
-	       $(libdir)/$(SLIBNAME_WITH_VERSION)
+	-rm -f $(shlibdir)/$(SLIBNAME_WITH_MAJOR) \
+	       $(shlibdir)/$(SLIBNAME)            \
+	       $(shlibdir)/$(SLIBNAME_WITH_VERSION)
 endif
 	-rm -f $(libdir)/$(LIB)
 
diff --git a/configure b/configure
index d540ff42cdbb538d9d6895c0920e7654a0fafd1b..fbe7939e83dc14f81fcadb66a6b599e94eefb062 100755
--- a/configure
+++ b/configure
@@ -530,7 +530,7 @@ audio_oss="yes"
 dv1394="no"
 make="gmake"
 LIBOBJFLAGS="\$(PIC)"
-LDCONFIG="ldconfig -m \$(libdir)"
+LDCONFIG="ldconfig -m \$(shlibdir)"
 extralibs="$extralibs -lossaudio"
 ;;
 FreeBSD)
@@ -567,8 +567,8 @@ v4l="no"
 v4l2="no"
 audio_oss="no"
 dv1394="no"
-SHFLAGS="-dynamiclib -Wl,-single_module -Wl,-install_name,\$(libdir)/\$(SLIBNAME),-current_version,\$(SPPVERSION),-compatibility_version,\$(SPPVERSION)"
-VHOOKFLAGS='-dynamiclib -Wl,-single_module -flat_namespace -undefined suppress -Wl,-install_name,$(libdir)/vhook/$@'
+SHFLAGS="-dynamiclib -Wl,-single_module -Wl,-install_name,\$(shlibdir)/\$(SLIBNAME),-current_version,\$(SPPVERSION),-compatibility_version,\$(SPPVERSION)"
+VHOOKFLAGS='-dynamiclib -Wl,-single_module -flat_namespace -undefined suppress -Wl,-install_name,$(shlibdir)/vhook/$@'
 extralibs=""
 strip="strip -x"
 installstrip=""