--- a/Makefile
+++ b/Makefile
@@ -45,6 +45,7 @@
   QUIET_CXX = @ echo "    CXX $@" ;
   QUIET_GEN = @ echo "    GEN $@" ;
   QUIET_LINK = @ echo "    LINK $@" ;
+  QUIET_LINK_FOR_BUILD = @ echo "    LINK_FOR_BUILD $@" ;
   QUIET_RM = @ echo "    RM $@" ;
   QUIET_TAGS = @ echo "    TAGS $@" ;
   QUIET_WINDRES = @ echo "    WINDRES $@" ;
@@ -61,6 +62,7 @@
   RANLIB_CMD = $(QUIET_RANLIB) $(RANLIB) $@
 endif
 LINK_CMD = $(QUIET_LINK) $(MKTGTDIR) ; $(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
+LINK_FOR_BUILD_CMD = $(QUIET_LINK_FOR_BUILD) $(MKTGTDIR) ; $(CC_FOR_BUILD) -o $@ $^
 TAGS_CMD = $(QUIET_TAGS) ctags -R --c-kinds=+p --exclude=platform/python --exclude=platform/c++
 WINDRES_CMD = $(QUIET_WINDRES) $(MKTGTDIR) ; $(WINDRES) $< $@
 OBJCOPY_CMD = $(QUIET_OBJCOPY) $(MKTGTDIR) ; $(LD) -r -b binary -z noexecstack -o $@ $<
@@ -82,7 +84,7 @@
 	$(RANLIB_CMD)
 
 $(OUT)/%.exe: %.c
-	$(LINK_CMD)
+	$(LINK_FOR_BUILD_CMD)
 
 $(OUT)/%.$(SO):
 	$(LINK_CMD) $(LIB_LDFLAGS) $(THIRD_LIBS) $(LIBCRYPTO_LIBS)
@@ -362,7 +364,7 @@
 $(OUT)/example: docs/examples/example.c $(MUPDF_LIB) $(THIRD_LIB)
 	$(LINK_CMD) $(CFLAGS) $(THIRD_LIBS)
 $(OUT)/multi-threaded: docs/examples/multi-threaded.c $(MUPDF_LIB) $(THIRD_LIB)
-	$(LINK_CMD) $(CFLAGS) $(THIRD_LIBS) -lpthread
+	$(LINK_CMD) $(CFLAGS) $(THIRD_LIBS)
 
 # --- Update version string header ---
 
@@ -396,7 +398,7 @@
 tools: $(TOOL_APPS)
 apps: $(TOOL_APPS) $(VIEW_APPS)
 
-install: libs apps
+install: libs tools
 	install -d $(DESTDIR)$(incdir)/mupdf
 	install -d $(DESTDIR)$(incdir)/mupdf/fitz
 	install -d $(DESTDIR)$(incdir)/mupdf/pdf
@@ -410,7 +412,7 @@
 endif
 
 	install -d $(DESTDIR)$(bindir)
-	install -m 755 $(LIBS_TO_INSTALL_IN_BIN) $(TOOL_APPS) $(VIEW_APPS) $(DESTDIR)$(bindir)
+	install -m 755 $(LIBS_TO_INSTALL_IN_BIN) $(TOOL_APPS) $(DESTDIR)$(bindir)
 
 	install -d $(DESTDIR)$(mandir)/man1
 	install -m 644 docs/man/*.1 $(DESTDIR)$(mandir)/man1
