Have you tried something like (add-before 'configure 'set-ldflags (lambda _ (substitute* "tecmake.mak" (("STDLDFLAGS := -shared" all) (string-append all " -Wl,-rpath="#$output "/lib"))))) not tested though. Also it looks like a cmake project, why are you not using the cmake-build-system? Cheers, -- Reza Housseini This message is signed with my GnuPG key: C0F3 0812 9AF2 80F4 0830 C2C1 C375 C6AF 0512 5C52