--- a/Makefile
+++ b/Makefile
@@ -297,19 +307,16 @@
 # --- Library ---
 
 ifeq ($(shared),yes)
-  $(OUT)/libmupdf.$(SO)$(SO_VERSION): $(MUPDF_OBJ) $(THIRD_OBJ)
-	$(LINK_SO_CMD) $(THIRD_LIBS) $(LIBCRYPTO_LIBS) $(LIBS)
-  ifeq ($(OS),OpenBSD)
-    # should never create symlink
-    MUPDF_LIB = $(OUT)/libmupdf.$(SO)$(SO_VERSION)
-  else
-    MUPDF_LIB = $(OUT)/libmupdf.$(SO)
-    ifneq ($(SO_VERSION),)
-      # create symlink with soname if needed
-      $(OUT)/libmupdf.$(SO): $(OUT)/libmupdf.$(SO)$(SO_VERSION)
-	$(SYMLINK_CMD) $(notdir $<) $@
-    endif
-  endif
+  MUPDF_STATIC = $(OUT)/libmupdf.a
+  $(MUPDF_STATIC): $(MUPDF_OBJ) $(THIRD_OBJ)
+  MUPDF_LIB = $(OUT)/libmupdf.$(SO)
+  $(MUPDF_LIB): $(MUPDF_STATIC)
+	$(LINK_SO_CMD) $(THIRD_LIBS) $(LIBCRYPTO_LIBS) $(LIBS) \
+	-Wl,--out-implib=$(MUPDF_LIB).a \
+	-Wl,--export-all-symbols \
+	-Wl,--enable-auto-import \
+	-Wl,--whole-archive $(MUPDF_STATIC) \
+	-Wl,--no-whole-archive $(THIRD_LIBS) $(LIBCRYPTO_LIBS) $(LIBS)
 else
   MUPDF_LIB = $(OUT)/libmupdf.a
   THIRD_LIB = $(OUT)/libmupdf-third.a
@@ -441,7 +433,7 @@
 
 third: $(THIRD_LIB)
 extra-libs: $(THIRD_GLUT_LIB)
-libs: $(MUPDF_LIB) $(THIRD_LIB) $(COMMERCIAL_LIBS)
+libs: $(MUPDF_LIB) $(MUPDF_STATIC)
 commercial-libs: $(COMMERCIAL_LIBS)
 tools: $(TOOL_APPS)
 apps: $(TOOL_APPS) $(VIEW_APPS)
@@ -458,12 +450,11 @@
 
 install-libs: libs install-headers
 	install -d $(DESTDIR)$(libdir)
+	install -d $(DESTDIR)$(bindir)
 ifeq ($(shared),yes)
-	install -m $(SO_INSTALL_MODE) $(OUT)/libmupdf.$(SO)$(SO_VERSION) $(DESTDIR)$(libdir)/libmupdf.$(SO)$(SO_VERSION)
-  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)
-  endif
+	install -m $(SO_INSTALL_MODE) $(OUT)/libmupdf.$(SO) $(DESTDIR)$(bindir)/libmupdf.$(SO)
+	install -m $(SO_INSTALL_MODE) $(OUT)/libmupdf.$(SO).a $(DESTDIR)$(libdir)/libmupdf.$(SO).a
+	install -m $(SO_INSTALL_MODE) $(OUT)/libmupdf.a $(DESTDIR)$(libdir)/libmupdf.a
 else
 	install -m 644 $(MUPDF_LIB) $(DESTDIR)$(libdir)
 	install -m 644 $(THIRD_LIB) $(DESTDIR)$(libdir)
