From: Michael R. Crusoe <michael.crusoe@gmail.com>
Subject: Inherit and use LDFLAGS and CPPFLAGS
Forwarded: https://github.com/rrwick/Unicycler/pull/343
--- a/Makefile
+++ b/Makefile
@@ -68,7 +68,7 @@ CXXFLAGS    ?= -Wall -Wextra -pedantic -
 
 # These flags are required for the build to work.
 FLAGS        = -std=c++14 -Iunicycler/include -fPIC
-LDFLAGS      = -shared -lz
+LDFLAGS      += -shared -lz
 
 
 # Platform-specific stuff (for Seqan)
@@ -117,4 +117,4 @@ distclean: clean
 	$(RM) $(TARGET)
 
 %.o: %.cpp $(HEADERS)
-	$(CXX) $(FLAGS) $(CXXFLAGS) -c -o $@ $<
+	$(CXX) $(CPPFLAGS) $(FLAGS) $(CXXFLAGS) -c -o $@ $<
