-lyx_DEPENDENCIES = mathed/libmathed.la insets/libinsets.la support/libsupport.la
-lyx_LDADD = $(lyx_DEPENDENCIES) @INTLLIBS@ $(LYX_LIBS)
+## libfrontends is given twice on the link line because it needs stuff
+## from FRONTEND_GUILIB and inversely. If you do not like it, feel
+## free to provide another solution... Maybe signals would solve that
+## magically, but I do not understand them much (JMarc)
+lyx_DEPENDENCIES = mathed/libmathed.la insets/libinsets.la \
+ graphics/libgraphics.la \
+ frontends/libfrontends.la @FRONTEND_GUILIB@ \
+ frontends/libfrontends.la \
+ frontends/support/libfrontendsupport.la support/libsupport.la \
+ @INCLUDED_SIGC@
+lyx_LDADD = $(lyx_DEPENDENCIES) @INTLLIBS@ $(LYX_LIBS) $(SIGC_LIBS) \
+ $(PSPELL_LIBS) @FRONTEND_LDFLAGS@ @FRONTEND_LIBS@
+#lyx_LDFLAGS=-Wl,-O1