diff --git a/HTSLIB/Makefile b/HTSLIB/Makefile
index 45e3683..d06f51f 100755
--- a/HTSLIB/Makefile
+++ b/HTSLIB/Makefile
@@ -22,31 +22,34 @@
 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 # DEALINGS IN THE SOFTWARE.

-CC     = gcc
-AR     = ar
-RANLIB = ranlib
+#CC     = gcc
+#AR     = ar
+#RANLIB = ranlib

 # Default libraries to link if configure is not used
-htslib_default_libs = -lz -lm -lbz2 -llzma -lcurl
+#htslib_default_libs = -lz -lm -lbz2 -llzma -lcurl

-CPPFLAGS =
+#CPPFLAGS =
 # TODO: make the 64-bit support for VCF optional via configure, for now add -DVCF_ALLOW_INT64
 #       to CFLAGS manually, here or in config.mk if the latter exists.
 # TODO: probably update cram code to make it compile cleanly with -Wc++-compat
 # For testing strict C99 support add -std=c99 -D_XOPEN_SOURCE=600
 #CFLAGS   = -g -Wall -O2 -pedantic -std=c99 -D_XOPEN_SOURCE=600
-CFLAGS   = -g -Wall -O2 -fvisibility=hidden
+#CFLAGS   = -g -Wall -O2 -fvisibility=hidden
 EXTRA_CFLAGS_PIC = -fpic
-LDFLAGS  = -fvisibility=hidden
+#LDFLAGS  = -fvisibility=hidden
 LIBS     = $(htslib_default_libs)

-prefix      = /usr/local
-exec_prefix = $(prefix)
+#prefix      = /usr/local
+#exec_prefix = $(prefix)
+exec_prefix = $(PREFIX)
 bindir      = $(exec_prefix)/bin
-includedir  = $(prefix)/include
+#includedir  = $(prefix)/include
+includedir  = $(PREFIX)/include
 libdir      = $(exec_prefix)/lib
 libexecdir  = $(exec_prefix)/libexec
-datarootdir = $(prefix)/share
+#datarootdir = $(prefix)/share
+datarootdir = $(PREFIX)/share
 mandir      = $(datarootdir)/man
 man1dir     = $(mandir)/man1
 man5dir     = $(mandir)/man5
@@ -217,10 +220,10 @@ thread_pool_internal_h = thread_pool_internal.h $(htslib_thread_pool_h)
 config.h:
 	echo '/* Default config.h generated by Makefile */' > $@
 	echo '#define HAVE_LIBBZ2 1' >> $@
-	echo '#define HAVE_LIBLZMA 1' >> $@
-	echo '#ifndef __APPLE__' >> $@
-	echo '#define HAVE_LZMA_H 1' >> $@
-	echo '#endif' >> $@
+#	echo '#define HAVE_LIBLZMA 1' >> $@
+#	echo '#ifndef __APPLE__' >> $@
+#	echo '#define HAVE_LZMA_H 1' >> $@
+#	echo '#endif' >> $@
 	echo '#define HAVE_DRAND48 1' >> $@
 	echo '#define HAVE_LIBCURL 1' >> $@

diff --git a/HTSLIB/config.h b/HTSLIB/config.h
index 36a010f..6b34f6d 100644
--- a/HTSLIB/config.h
+++ b/HTSLIB/config.h
@@ -1,8 +1,4 @@
 /* Default config.h generated by Makefile */
 #define HAVE_LIBBZ2 1
-#define HAVE_LIBLZMA 1
-#ifndef __APPLE__
-#define HAVE_LZMA_H 1
-#endif
 #define HAVE_DRAND48 1
 #define HAVE_LIBCURL 1
diff --git a/HTSLIB/configure.ac b/HTSLIB/configure.ac
index a5635bc..4b1ab96 100755
--- a/HTSLIB/configure.ac
+++ b/HTSLIB/configure.ac
@@ -275,8 +275,8 @@ xz (via Homebrew on macOS) is installed; or build XZ Utils from source.
 Either configure with --disable-lzma (which will make some CRAM files
 produced elsewhere unreadable) or resolve this error to build HTSlib.])
   fi
-  pc_requires="$pc_requires liblzma"
-  static_LIBS="$static_LIBS -llzma"
+  pc_requires="$pc_requires"
+  static_LIBS="$static_LIBS"
 fi

 AS_IF([test "x$with_libdeflate" != "xno"],
diff --git a/HTSLIB/htslib.pc.tmp b/HTSLIB/htslib.pc.tmp
index 6784926..12abb6e 100644
--- a/HTSLIB/htslib.pc.tmp
+++ b/HTSLIB/htslib.pc.tmp
@@ -4,7 +4,7 @@ libdir=@-libdir@
 # Flags and libraries needed when linking against a static libhts.a
 # (used by manual and semi-manual pkg-config(1)-style enquiries).
 static_ldflags=
-static_libs=-lz -lm -lbz2 -llzma -lcurl
+static_libs=-lz -lm -lbz2 -lcurl

 Name: htslib
 Description: C library for high-throughput sequencing data formats
diff --git a/HTSLIB/htslib_static.mk b/HTSLIB/htslib_static.mk
index e314b85..a01d4c3 100644
--- a/HTSLIB/htslib_static.mk
+++ b/HTSLIB/htslib_static.mk
@@ -1,2 +1,2 @@
 HTSLIB_static_LDFLAGS =
-HTSLIB_static_LIBS = -lz -lm -lbz2 -llzma -lcurl
+HTSLIB_static_LIBS = -lz -lm -lbz2 -lcurl
diff --git a/LIBDEFLATE/Makefile b/LIBDEFLATE/Makefile
index 44fefaf..19139e8 100755
--- a/LIBDEFLATE/Makefile
+++ b/LIBDEFLATE/Makefile
@@ -40,21 +40,6 @@
 cc-option = $(shell if $(CC) $(1) -c -x c /dev/null -o /dev/null \
 	      1>&2 2>/dev/null; then echo $(1); fi)

-override CFLAGS :=							\
-	-O2 -fomit-frame-pointer $(CFLAGS) -std=c99 -I. -Icommon	\
-	-Wall -Wundef							\
-	$(call cc-option,-Wpedantic)					\
-	$(call cc-option,-Wdeclaration-after-statement)			\
-	$(call cc-option,-Wmissing-prototypes)				\
-	$(call cc-option,-Wstrict-prototypes)				\
-	$(call cc-option,-Wvla)						\
-	$(call cc-option,-Wimplicit-fallthrough)
-
-# We don't define any CPPFLAGS, but support the user specifying it.
-
-##############################################################################
-
-PREFIX ?= /usr/local
 BINDIR ?= $(PREFIX)/bin
 INCDIR ?= $(PREFIX)/include
 LIBDIR ?= $(PREFIX)/lib
@@ -76,7 +61,6 @@ ifneq ($(findstring -mingw,$(shell $(CC) -dumpmachine 2>/dev/null)),)
     PROG_SUFFIX        := .exe
     PROG_CFLAGS        := -static -municode
     HARD_LINKS         :=
-    override CFLAGS    := $(CFLAGS) $(call cc-option,-Wno-pedantic-ms-format)

     # If AR was not already overridden, then derive it from $(CC).
     # Note that CC may take different forms, e.g. "cc", "gcc",
diff --git a/Makefile b/Makefile
index 70722f3..e324eb7 100644
--- a/Makefile
+++ b/Makefile
@@ -1,12 +1,23 @@
-DEST_DIR = ~/bin
-
-CFLAGS = -O3 -Wall -Wextra -Wno-unused-result -fno-strict-aliasing
-
-CC = gcc
-
-ALL = FastK Fastrm Fastmv Fastcp Fastmerge Histex Tabex Profex Logex Vennex Symmex Haplex Homex Fastcat KmerMap
-
-all: deflate.lib libhts.a $(ALL)
+DEST_DIR = $(PREFIX)/bin
+INSTALL = install -v -m 0755
+
+PROGRAMS = FastK \
+		Fastrm \
+		Fastmv \
+		Fastcp \
+		Fastmerge \
+		Histex \
+		Tabex \
+		Profex \
+		Logex \
+		Vennex \
+		Symmex \
+		Haplex \
+		Homex \
+		Fastcat \
+		KmerMap
+
+all: deflate.lib libhts.a $(PROGRAMS)
 
 include HTSLIB/htslib_static.mk
 
@@ -14,7 +25,7 @@ deflate.lib: LIBDEFLATE
 	cd LIBDEFLATE; make; cd ..
 
 libhts.a: HTSLIB
-	cd HTSLIB; make libhts.a; cd ..
+	cd HTSLIB; make lib-static; cd ..
 
 HTSLIB/htslib_static.mk:
 	cd HTSLIB; make htslib_static.mk; cd ..
@@ -23,49 +34,49 @@ libfastk.c : gene_core.c
 libfastk.h : gene_core.h
 
 FastK: FastK.c FastK.h io.c split.c count.c table.c merge.c io.c gene_core.c gene_core.h MSDsort.c LSDsort.c libfastk.c libfastk.h
-	$(CC) $(CFLAGS) -o FastK -I./HTSLIB $(HTSLIB_static_LDFLAGS) FastK.c io.c split.c count.c table.c merge.c MSDsort.c LSDsort.c libfastk.c LIBDEFLATE/libdeflate.a HTSLIB/libhts.a -lpthread $(HTSLIB_static_LIBS)
+	$(CC) $(CFLAGS) -o FastK -I./HTSLIB $(HTSLIB_static_LDFLAGS) FastK.c io.c split.c count.c table.c merge.c MSDsort.c LSDsort.c libfastk.c LIBDEFLATE/libdeflate.a HTSLIB/libhts.a -pthread $(HTSLIB_static_LIBS)
 
 Fastrm: Fastrm.c gene_core.c gene_core.h
-	$(CC) $(CFLAGS) -o Fastrm Fastrm.c gene_core.c -lpthread -lm
+	$(CC) $(CFLAGS) -o Fastrm Fastrm.c gene_core.c -pthread -lm
 
 Fastmv: Fastxfer.c gene_core.c gene_core.h
-	$(CC) $(CFLAGS) -DMOVE -o Fastmv Fastxfer.c gene_core.c -lpthread -lm
+	$(CC) $(CFLAGS) -DMOVE -o Fastmv Fastxfer.c gene_core.c -pthread -lm
 
 Fastcp: Fastxfer.c gene_core.c gene_core.h
-	$(CC) $(CFLAGS) -UMOVE -o Fastcp Fastxfer.c gene_core.c -lpthread -lm
+	$(CC) $(CFLAGS) -UMOVE -o Fastcp Fastxfer.c gene_core.c -pthread -lm
 
 Fastmerge: Fastmerge.c libfastk.c libfastk.h
-	$(CC) $(CFLAGS) -o Fastmerge Fastmerge.c libfastk.c -lpthread -lm
+	$(CC) $(CFLAGS) -o Fastmerge Fastmerge.c libfastk.c -pthread -lm
 
 Fastcat: Fastcat.c libfastk.c libfastk.h
-	$(CC) $(CFLAGS) -o Fastcat Fastcat.c libfastk.c -lpthread -lm
+	$(CC) $(CFLAGS) -o Fastcat Fastcat.c libfastk.c -pthread -lm
 
 Histex: Histex.c libfastk.c libfastk.h ONElib.h ONElib.c
-	$(CC) $(CFLAGS) -o Histex Histex.c libfastk.c ONElib.c -lpthread -lm
+	$(CC) $(CFLAGS) -o Histex Histex.c libfastk.c ONElib.c -pthread -lm
 
 Tabex: Tabex.c libfastk.c libfastk.h ONElib.h ONElib.c
-	$(CC) $(CFLAGS) -o Tabex Tabex.c libfastk.c ONElib.c -lpthread -lm
+	$(CC) $(CFLAGS) -o Tabex Tabex.c libfastk.c ONElib.c -pthread -lm
 
 Profex: Profex.c libfastk.c libfastk.h ONElib.h ONElib.c
-	$(CC) $(CFLAGS) -o Profex Profex.c libfastk.c ONElib.c -lpthread -lm
+	$(CC) $(CFLAGS) -o Profex Profex.c libfastk.c ONElib.c -pthread -lm
 
 Logex: Logex.c libfastk.c libfastk.h
-	$(CC) $(CFLAGS) -o Logex Logex.c libfastk.c -lpthread -lm
+	$(CC) $(CFLAGS) -o Logex Logex.c libfastk.c -pthread -lm
 
 Vennex: Vennex.c libfastk.c libfastk.h
-	$(CC) $(CFLAGS) -o Vennex Vennex.c libfastk.c -lpthread -lm
+	$(CC) $(CFLAGS) -o Vennex Vennex.c libfastk.c -pthread -lm
 
 Symmex: Symmex.c libfastk.c libfastk.h LSDsort.c
-	$(CC) $(CFLAGS) -o Symmex Symmex.c libfastk.c LSDsort.c -lpthread -lm
+	$(CC) $(CFLAGS) -o Symmex Symmex.c libfastk.c LSDsort.c -pthread -lm
 
 Haplex: Haplex.c libfastk.c libfastk.h
-	$(CC) $(CFLAGS) -o Haplex Haplex.c libfastk.c -lpthread -lm
+	$(CC) $(CFLAGS) -o Haplex Haplex.c libfastk.c -pthread -lm
 
 Homex: Homex.c libfastk.c libfastk.h
-	$(CC) $(CFLAGS) -o Homex Homex.c libfastk.c -lpthread -lm
+	$(CC) $(CFLAGS) -o Homex Homex.c libfastk.c -pthread -lm
 
 KmerMap: KmerMap.c libfastk.c libfastk.h
-	$(CC) $(CFLAGS) -o KmerMap KmerMap.c libfastk.c -lpthread -lm
+	$(CC) $(CFLAGS) -o KmerMap KmerMap.c libfastk.c -pthread -lm
 
 
 tidyup:
@@ -81,7 +92,7 @@ clean:
 	rm -f FastK.tar.gz
 
 install:
-	cp $(ALL) $(DEST_DIR)
+	$(INSTALL) $(PROGRAMS) $(DEST_DIR)
 
 package:
 	make clean
