diff --git a/Makefile b/Makefile
index a6c8c64..5276f96 100644
--- a/Makefile
+++ b/Makefile
@@ -1720,33 +1720,35 @@ defer_test: util/defer_test.o $(LIBOBJECTS) $(TESTHARNESS)
 
 #-------------------------------------------------
 # make install related stuff
-INSTALL_PATH ?= /usr/local
+INSTALL_PREFIX ?= /
+INCLUDE_INSTAL_DIR ?= /usr/local/include/
+LIB_INSTALL_DIR ?= /usr/local/lib/
 
 uninstall:
-	rm -rf $(INSTALL_PATH)/include/rocksdb \
-	  $(INSTALL_PATH)/lib/$(LIBRARY) \
-	  $(INSTALL_PATH)/lib/$(SHARED4) \
-	  $(INSTALL_PATH)/lib/$(SHARED3) \
-	  $(INSTALL_PATH)/lib/$(SHARED2) \
-	  $(INSTALL_PATH)/lib/$(SHARED1)
+	rm -rf $(INSTALL_PREFIX)/$(INCLUDE_INSTALL_DIR)/rocksdb \
+	  $(INSTALL_PREFIX)/$(LIB_INSTALL_DIR)/$(LIBRARY) \
+	  $(INSTALL_PREFIX)/$(LIB_INSTALL_DIR)/$(SHARED4) \
+	  $(INSTALL_PREFIX)/$(LIB_INSTALL_DIR)/$(SHARED3) \
+	  $(INSTALL_PREFIX)/$(LIB_INSTALL_DIR)/$(SHARED2) \
+	  $(INSTALL_PREFIX)/$(LIB_INSTALL_DIR)/$(SHARED1)
 
 install-headers:
-	install -d $(INSTALL_PATH)/lib
-	for header_dir in `$(FIND) "include/rocksdb" -type d`; do \
-		install -d $(INSTALL_PATH)/$$header_dir; \
+	install -d $(INSTALL_PREFIX)/$(LIB_INSTALL_DIR)
+	for header_dir in $$(find "include/rocksdb" -type d|sed -r 's/^([^\/]*\/)//'); do \
+		install -d $(INSTALL_PREFIX)/$(INCLUDE_INSTALL_DIR)/$$header_dir; \
 	done
-	for header in `$(FIND) "include/rocksdb" -type f -name *.h`; do \
-		install -C -m 644 $$header $(INSTALL_PATH)/$$header; \
+	for header in $$(find "include/rocksdb" -type f -name *.h|sed -r 's/^([^\/]*\/)//'); do \
+                install -C -m 644 "include/$$header" $(INSTALL_PREFIX)/$(INCLUDE_INSTALL_DIR)/$$header; \
 	done
 
 install-static: install-headers $(LIBRARY)
-	install -C -m 755 $(LIBRARY) $(INSTALL_PATH)/lib
+	install -C -m 755 $(INSTALL_PREFIX)/$(LIB_INSTALL_DIR)
 
 install-shared: install-headers $(SHARED4)
-	install -C -m 755 $(SHARED4) $(INSTALL_PATH)/lib && \
-		ln -fs $(SHARED4) $(INSTALL_PATH)/lib/$(SHARED3) && \
-		ln -fs $(SHARED4) $(INSTALL_PATH)/lib/$(SHARED2) && \
-		ln -fs $(SHARED4) $(INSTALL_PATH)/lib/$(SHARED1)
+	install -C -m 755 $(SHARED4) $(INSTALL_PREFIX)/$(LIB_INSTALL_DIR) && \
+		ln -fs $(SHARED4) $(INSTALL_PREFIX)/$(LIB_INSTALL_DIR)/$(SHARED3) && \
+		ln -fs $(SHARED4) $(INSTALL_PREFIX)/$(LIB_INSTALL_DIR)/$(SHARED2) && \
+		ln -fs $(SHARED4) $(INSTALL_PREFIX)/$(LIB_INSTALL_DIR)/$(SHARED1)
 
 # install static by default + install shared if it exists
 install: install-static
