--- src/Makevars	2016-10-12 07:06:31.000000000 -0500
+++ src/Makevars.new	2017-01-24 14:26:30.000000000 -0600
@@ -47,7 +47,7 @@
 	cd $(HTSDIR)/ && ./configure --disable-dependency-tracking \
 	--prefix="${R_PACKAGE_DIR}" \
 	CC="${R_CC}" CFLAGS="${R_CFLAGS} ${R_CPICFLAGS}" \
-	LDFLAGS="${R_LDFLAGS}" CPPFLAGS="${R_CPPFLAGS}" CPP="${R_CPP}"
+	LDFLAGS="${R_LDFLAGS} -Wl,-rpath,${PREFIX}/lib" CPPFLAGS="${R_CPPFLAGS}" CPP="${R_CPP}"
 	@echo "buildling library..."
 	cd $(HTSDIR)/ && $(MAKE)
 
