Make sure that libdm usage always brings in pthread libraries, both in
pkgconfig and during manual build.

Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>

diff -Nuar LVM2.2.02.105.orig/libdm/libdevmapper.pc.in LVM2.2.02.105/libdm/libdevmapper.pc.in
--- LVM2.2.02.105.orig/libdm/libdevmapper.pc.in	2014-01-20 11:25:30.000000000 -0800
+++ LVM2.2.02.105/libdm/libdevmapper.pc.in	2014-02-01 14:50:58.805455421 -0800
@@ -8,4 +8,5 @@
 Version: @DM_LIB_PATCHLEVEL@
 Cflags: -I${includedir} 
 Libs: -L${libdir} -ldevmapper
+Libs.private: -L${libdir} @PTHREAD_LIBS@
 Requires.private: @SELINUX_PC@ @UDEV_PC@
diff -Nuar LVM2.2.02.105/tools/Makefile.in LVM2.2.02.105.orig/tools/Makefile.in
--- LVM2.2.02.105/tools/Makefile.in	2014-02-03 18:33:19.032894499 -0800
+++ LVM2.2.02.105.orig/tools/Makefile.in	2014-02-03 18:36:41.738459116 -0800
@@ -86,6 +86,7 @@
   INSTALL_LVM_TARGETS += install_tools_static
   INSTALL_DMSETUP_TARGETS += install_dmsetup_static
   INSTALL_CMDLIB_TARGETS += install_cmdlib_static
+  STATIC_LIBS += @PTHREAD_LIBS@
 endif
 
 LVMLIBS = $(LVMINTERNAL_LIBS)
@@ -119,6 +119,10 @@
 
 include $(top_builddir)/make.tmpl
 
+ifeq ("@STATIC_LINK@", "yes")
+  STATIC_LIBS += @PTHREAD_LIBS@
+endif
+
 device-mapper: $(TARGETS_DM)
 
 CFLAGS_dmsetup.o += $(UDEV_CFLAGS) $(EXTRA_EXEC_CFLAGS)
