diff --git a/.gitattributes b/.gitattributes
index 605cd0f03de0caf491cc94ecffde723cb73f5fd9..f58804128a541e6f5544da4326ca123041691187 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1,6 +1,6 @@
 * text=auto !eol
 /LICENSE.txt -text
-/Makefile -text
+/Makefile.in -text
 include/memory_space.h -text
 include/nonce_relocs.h -text
 include/range.h -text
@@ -10,7 +10,7 @@ include/zipr_all.h -text
 include/zipr_optimizations.h -text
 include/zipr_options.h -text
 include/zipr_stats.h -text
-src/Makefile -text
+src/Makefile.in -text
 src/main.cpp -text
 src/memory_space.cpp -text
 src/nonce_relocs.cpp -text
diff --git a/Makefile b/Makefile.in
similarity index 56%
rename from Makefile
rename to Makefile.in
index c407c02b1614a8b76fde34de225451f646076d88..28c71b9cd0183788185116fc639c9165c63f8e2f 100644
--- a/Makefile
+++ b/Makefile.in
@@ -1,9 +1,13 @@
 
+
+
+bdir=@prefix@
+
 all:
 	cd src;make
 
 install: all
-	cp src/zipr.exe bin
+	cp src/zipr.exe $(bdir)/bin
 
 clean:
 	cd src;make clean
diff --git a/src/Makefile b/src/Makefile.in
similarity index 97%
rename from src/Makefile
rename to src/Makefile.in
index 7882712cfabc8ea7eed378fb97edb88b8352ba60..5d32614e6781bbb6d079e6b459251b9f64856530 100644
--- a/src/Makefile
+++ b/src/Makefile.in
@@ -8,7 +8,7 @@ OBJS=$(subst .cpp,.o, $(SRCS))
 EXE=zipr.exe
 
 CXX=g++
-CXXFLAGS=$(INC) -g -DCGC
+CXXFLAGS=$(INC) @OPTIMIZE@
 LDFLAGS=-L$(SECURITY_TRANSFORMS_HOME)/lib
 LIBS=-lpqxx -lpq -lIRDB-core -lBeaEngine_s_d -ltransform ${SECURITY_TRANSFORMS_HOME}/tools/transforms/Rewrite_Utility.o