From NetBSD:
Force proper LDFLAGS for MODULE, as cmake doesn't set rpath for these
Index: pagelayout_editor/CMakeLists.txt
--- pagelayout_editor/CMakeLists.txt.orig
+++ pagelayout_editor/CMakeLists.txt
@@ -117,6 +117,9 @@ target_link_options( pl_editor_kiface PRIVATE
     $<$<BOOL:${KICAD_MAKE_LINK_MAPS}>:-Wl,--cref,-Map=_pl_editor.kiface.map>
     )
 
+set_property(TARGET pl_editor_kiface APPEND_STRING
+      PROPERTY LINK_FLAGS " $ENV{LDFLAGS}")
+
 # if building pl_editor, then also build pl_editor_kiface if out of date.
 add_dependencies( pl_editor pl_editor_kiface )
 
