--- a/src/ui/wxWidgets/Makefile
+++ b/src/ui/wxWidgets/Makefile
@@ -145,7 +145,12 @@
 
 CPPINC += -I../..
 
-LDFLAGS=$(LIBS) -L$(LIBPATH) $(LINKERFLAGS) $(XERCESLIBFLAGS)
+ifndef NO_YUBI
+YBPERS_LIBPATH?=$(LIBPATH)
+YBPERS_LIBPATH_FLAGS=-L$(YBPERS_LIBPATH)
+endif
+
+LDFLAGS=$(LIBS) -L$(LIBPATH) $(LINKERFLAGS) $(XERCESLIBFLAGS) $(YBPERS_LIBPATH_FLAGS)
 CPPFLAGS=$(CXXFLAGS) $(CPPINC) $(GCCFLAGS) $(DEBUGFLAGS) $(OPTFLAGS) $(WARNINGFLAGS) $(XERCESCPPFLAGS) $(YUBIFLAGS)
 
 SOURCES= passwordsafeframe.cpp \