--- Makefile.orig	2016-11-05 23:22:07 UTC
+++ Makefile
@@ -6,9 +6,9 @@ VERSION = 1.3.4
 PREFIX  ?= /usr/local
 CC      ?= gcc
 # using OPTFLAGS/OPTLDFLAGS for compatibilty with old scripts using this makefile
-OPTFLAGS = -O2 -DNDEBUG -fomit-frame-pointer -ffunction-sections -fdata-sections
+OPTFLAGS = -DNDEBUG -fomit-frame-pointer -ffunction-sections -fdata-sections
 OPTLDFLAGS =
-CFLAGS = $(OPTFLAGS)
+CFLAGS += $(OPTFLAGS)
 LDFLAGS = $(OPTLDFLAGS)
 ADDCFLAGS =
 ADDLDFLAGS =
@@ -106,7 +106,7 @@ install-man:
 
 install-conf:
 	$(INSTALL) -d $(DESTDIR)/etc
-	tr -d \\r < dist/rhashrc.sample > rc.tmp && $(INSTALL_DATA) rc.tmp $(DESTDIR)/etc/rhashrc
+	tr -d \\r < dist/rhashrc.sample > rc.tmp && $(INSTALL_DATA) rc.tmp $(DESTDIR)$(PREFIX)/etc/rhashrc.sample
 	rm -f rc.tmp
 
 # dependencies should be properly set, otherwise 'make -j<n>' can fail
@@ -127,7 +127,7 @@ install-lib-static: $(LIBRHASH)
 	+make -C librhash install-lib-static
 
 install-lib-shared: $(SHAREDLIB)
-	+$(MAKE) -C librhash install-lib-shared
+	+$(MAKE) -C librhash install-lib-shared install-so-link
 
 $(SHAREDLIB):
 	+make -C librhash lib-shared
