--- a/make.tmpl.in
+++ b/make.tmpl.in
@@ -17,9 +17,10 @@
 
 @SET_MAKE@
 
-CC ?= @CC@
+CC = @CC@
 RANLIB = @RANLIB@
 INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL@ -m 644
 MKDIR_P = @MKDIR_P@
 MSGFMT = @MSGFMT@
 LCOV = @LCOV@
@@ -74,8 +75,7 @@
 tmpfiles_dir = $(DESTDIR)@tmpfilesdir@
 ocf_scriptdir = $(DESTDIR)@OCFDIR@
 
-USRLIB_RELPATH = $(shell echo $(abspath $(usrlibdir) $(libdir)) | \
-  $(AWK) -f $(top_srcdir)/scripts/relpath.awk)
+USRLIB_RELPATH = @libdir@/
 
 DEFAULT_SYS_DIR = @DEFAULT_SYS_DIR@
 DEFAULT_ARCHIVE_DIR = $(DEFAULT_SYS_DIR)/@DEFAULT_ARCHIVE_SUBDIR@
@@ -99,22 +99,14 @@
 endif
 
 # Handle installation of files
-ifeq ("@WRITE_INSTALL@", "yes")
-# leaving defaults
-M_INSTALL_SCRIPT =
-M_INSTALL_DATA = -m 644
-else
-M_INSTALL_PROGRAM = -m 555
-M_INSTALL_DATA = -m 444
-endif
-INSTALL_PROGRAM = $(INSTALL) $(M_INSTALL_PROGRAM) $(STRIP)
-INSTALL_DATA = $(INSTALL) -p $(M_INSTALL_DATA)
-INSTALL_WDATA = $(INSTALL) -p -m 644
+INSTALL_PROGRAM = $(INSTALL)
+INSTALL_DATA = $(INSTALL) -m 644
+INSTALL_WDATA = $(INSTALL_DATA)
 
 INSTALL_DIR = $(INSTALL) -m 755 -d
 INSTALL_ROOT_DIR = $(INSTALL) -m 700 -d
 INSTALL_ROOT_DATA = $(INSTALL) -m 600
-INSTALL_SCRIPT = $(INSTALL) -p $(M_INSTALL_PROGRAM)
+INSTALL_SCRIPT = $(INSTALL_PROGRAM)
 
 .SUFFIXES: .c .d .o .so .a .po .pot .mo .dylib
 
@@ -346,17 +338,14 @@
 	$(INSTALL_DIR) $(usrlibdir)
 	$(LN_S) -f $(USRLIB_RELPATH)$(<F).$(LIB_VERSION) $(usrlibdir)/$(<F)
 
-# FIXME: plugins are installed to subdirs 
-#        and for compatibility links in libdir are created
-#        when the code is fixed links could be removed.
+install_dm_lib: $(LIB_SHARED)
+	$(INSTALL_PROGRAM) -D $< $(libdir)/device-mapper/$(<F).$(LIB_VERSION)
+
 install_dm_plugin: $(LIB_SHARED)
 	$(INSTALL_PROGRAM) -D $< $(libdir)/device-mapper/$(<F)
-	$(LN_S) -f device-mapper/$(<F) $(libdir)/$(<F)
 
 install_lvm2_plugin: $(LIB_SHARED)
 	$(INSTALL_PROGRAM) -D $< $(libdir)/lvm2/$(<F)
-	$(LN_S) -f lvm2/$(<F) $(libdir)/$(<F)
-	$(LN_S) -f $(<F) $(libdir)/$(<F).$(LIB_VERSION)
 endif
 
 $(LIB_STATIC): $(OBJECTS)
--- a/daemons/dmeventd/plugins/mirror/Makefile.in
+++ b/daemons/dmeventd/plugins/mirror/Makefile.in
@@ -30,6 +30,7 @@
 
 include $(top_builddir)/make.tmpl
 
+CLDFLAGS += -Wl,-rpath,'$$ORIGIN'
 LIBS += -ldevmapper-event-lvm2 -ldevmapper $(DAEMON_LIBS)
 
 install_lvm2: install_dm_plugin
--- a/daemons/dmeventd/plugins/raid/Makefile.in
+++ b/daemons/dmeventd/plugins/raid/Makefile.in
@@ -29,6 +29,7 @@
 
 include $(top_builddir)/make.tmpl
 
+CLDFLAGS += -Wl,-rpath,'$$ORIGIN'
 LIBS += -ldevmapper-event-lvm2 -ldevmapper
 
 install_lvm2: install_dm_plugin
--- a/daemons/dmeventd/plugins/snapshot/Makefile.in
+++ b/daemons/dmeventd/plugins/snapshot/Makefile.in
@@ -26,6 +26,7 @@
 
 include $(top_builddir)/make.tmpl
 
+CLDFLAGS += -Wl,-rpath,'$$ORIGIN'
 LIBS += -ldevmapper-event-lvm2 -ldevmapper $(DAEMON_LIBS)
 
 install_lvm2: install_dm_plugin
--- a/daemons/dmeventd/plugins/thin/Makefile.in
+++ b/daemons/dmeventd/plugins/thin/Makefile.in
@@ -29,6 +29,7 @@
 
 include $(top_builddir)/make.tmpl
 
+CLDFLAGS += -Wl,-rpath,'$$ORIGIN'
 LIBS += -ldevmapper-event-lvm2 -ldevmapper
 
 install_lvm2: install_dm_plugin
--- a/daemons/dmeventd/plugins/lvm2/Makefile.in
+++ b/daemons/dmeventd/plugins/lvm2/Makefile.in
@@ -26,6 +26,6 @@
 
 LIBS += @LVM2CMD_LIB@ -ldevmapper $(PTHREAD_LIBS) $(DAEMON_LIBS)
 
-install_lvm2: install_lib_shared
+install_lvm2: install_dm_lib
 
 install: install_lvm2
