diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -341,6 +341,23 @@ ifeq ($(shared),yes)
 	$(SYMLINK_CMD) $(notdir $<) $@
     endif
   endif
+  THIRD_LIB = $(OUT)/libmupdf-third.$(SO)
+  $(THIRD_LIB) : $(THIRD_OBJ)
+	$(LINK_SO_CMD) $(THIRD_LIBS) $(LIBCRYPTO_LIBS) $(LIBS)
+
+ifneq ($(USE_SYSTEM_GLUT),yes)
+  THIRD_GLUT_LIB = $(OUT)/libmupdf-glut.$(SO)
+  $(THIRD_GLUT_LIB) : $(THIRD_GLUT_OBJ)
+	$(LINK_SO_CMD) $(THIRD_GLUT_LIBS) $(LIBCRYPTO_LIBS) $(LIBS)
+endif
+
+THREAD_LIB = $(OUT)/libmupdf-threads.$(SO)
+$(THREAD_LIB) : $(THREAD_OBJ)
+	$(LINK_SO_CMD) $(THREAD_LIBS) $(LIBCRYPTO_LIBS) $(LIBS)
+
+PKCS7_LIB = $(OUT)/libmupdf-pkcs7.$(SO)
+$(PKCS7_LIB) : $(PKCS7_OBJ)
+	$(LINK_SO_CMD) $(PKCS7_LIBS) $(LIBCRYPTO_LIBS) $(LIBS)
 else
   MUPDF_LIB = $(OUT)/libmupdf.a
   ifneq ($(THIRD_OBJ),)
@@ -349,7 +366,6 @@ else
   endif
   $(MUPDF_LIB) : $(MUPDF_OBJ)
   $(THIRD_LIB) : $(THIRD_OBJ)
-endif
 
 ifneq ($(USE_SYSTEM_GLUT),yes)
   THIRD_GLUT_LIB = $(OUT)/libmupdf-glut.a
@@ -361,6 +377,7 @@ $(THREAD_LIB) : $(THREAD_OBJ)
 
 PKCS7_LIB = $(OUT)/libmupdf-pkcs7.a
 $(PKCS7_LIB) : $(PKCS7_OBJ)
+endif
 
 # --- Main tools and viewers ---
 
@@ -471,7 +488,7 @@ SO_INSTALL_MODE ?= 644
 
 third: $(THIRD_LIB)
 extra-libs: $(THIRD_GLUT_LIB)
-libs: $(MUPDF_LIB) $(THIRD_LIB) $(COMMERCIAL_LIBS)
+libs: $(MUPDF_LIB) $(THIRD_LIB) $(COMMERCIAL_LIBS) $(THREAD_LIB) $(PKCS7_LIB)
 commercial-libs: $(COMMERCIAL_LIBS)
 tools: $(TOOL_APPS)
 apps: $(TOOL_APPS) $(VIEW_APPS)
@@ -490,6 +507,12 @@ install-libs: libs install-headers
 	install -d $(DESTDIR)$(libdir)
 ifeq ($(shared),yes)
 	install -m $(SO_INSTALL_MODE) $(OUT)/libmupdf.$(SO)$(SO_VERSION) $(DESTDIR)$(libdir)/libmupdf.$(SO)$(SO_VERSION)
+	install -m $(SO_INSTALL_MODE) $(THIRD_LIB) $(DESTDIR)$(libdir)
+	install -m $(SO_INSTALL_MODE) $(THREAD_LIB) $(DESTDIR)$(libdir)
+	install -m $(SO_INSTALL_MODE) $(PKCS7_LIB) $(DESTDIR)$(libdir)
+  ifneq ($(USE_SYSTEM_GLUT),yes)
+	install -m $(SO_INSTALL_MODE) $(THIRD_GLUT_LIB) $(DESTDIR)$(libdir)
+  endif
   ifneq ($(OS),OpenBSD)
 	ln -sf libmupdf.$(SO)$(SO_VERSION) $(DESTDIR)$(libdir)/libmupdf.$(SO)$(SO_VERSION_MAJOR)
 	ln -sf libmupdf.$(SO)$(SO_VERSION) $(DESTDIR)$(libdir)/libmupdf.$(SO)
