Index: Makefile.in
--- Makefile.in.orig	2016-02-23 15:24:08.000000000 +0100
+++ Makefile.in	2016-02-28 20:25:28.743347434 +0100
@@ -436,7 +436,7 @@
 
 CLEANFILES = freedesktop.org.xml po/stamp-it
 DISTCLEANFILES = intltool-extract intltool-merge intltool-update
-pkgconfigdir = $(datadir)/pkgconfig
+pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = shared-mime-info.pc
 @CROSS_COMPILING_FALSE@update_mime_database = "$(top_builddir)/update-mime-database$(EXEEXT)"
 @CROSS_COMPILING_TRUE@update_mime_database = $(UPDATE_MIME_DATABASE)
@@ -544,15 +544,15 @@
 
 test-subclassing$(EXEEXT): $(test_subclassing_OBJECTS) $(test_subclassing_DEPENDENCIES) $(EXTRA_test_subclassing_DEPENDENCIES) 
 	@rm -f test-subclassing$(EXEEXT)
-	$(AM_V_CCLD)$(test_subclassing_LINK) $(test_subclassing_OBJECTS) $(test_subclassing_LDADD) $(LIBS)
+	$(AM_V_CCLD)$(test_subclassing_LINK) $(test_subclassing_OBJECTS) $(test_subclassing_LDADD) $(LIBS) $(ALL_LIBS)
 
 test-tree-magic$(EXEEXT): $(test_tree_magic_OBJECTS) $(test_tree_magic_DEPENDENCIES) $(EXTRA_test_tree_magic_DEPENDENCIES) 
 	@rm -f test-tree-magic$(EXEEXT)
-	$(AM_V_CCLD)$(test_tree_magic_LINK) $(test_tree_magic_OBJECTS) $(test_tree_magic_LDADD) $(LIBS)
+	$(AM_V_CCLD)$(test_tree_magic_LINK) $(test_tree_magic_OBJECTS) $(test_tree_magic_LDADD) $(LIBS) $(ALL_LIBS)
 
 update-mime-database$(EXEEXT): $(update_mime_database_OBJECTS) $(update_mime_database_DEPENDENCIES) $(EXTRA_update_mime_database_DEPENDENCIES) 
 	@rm -f update-mime-database$(EXEEXT)
-	$(AM_V_CCLD)$(update_mime_database_LINK) $(update_mime_database_OBJECTS) $(update_mime_database_LDADD) $(LIBS)
+	$(AM_V_CCLD)$(update_mime_database_LINK) $(update_mime_database_OBJECTS) $(update_mime_database_LDADD) $(LIBS) $(ALL_LIBS)
 
 mostlyclean-compile:
 	-rm -f *.$(OBJEXT)
