diff --git a/Makefile.moddir_rules b/Makefile.moddir_rules
index 54113de741785a76e645f21d70d0a05de27b5f3b..988f484d4de5a89e639c3140d79dc66849bd1a7a 100644
--- a/Makefile.moddir_rules
+++ b/Makefile.moddir_rules
@@ -66,9 +66,8 @@ _all: $(LOADABLE_MODS:%=%.so)
 ifneq ($(findstring $(OSARCH), mingw32 cygwin ),)
   # linker options and extra libraries for cygwin
   SOLINK=-Wl,--out-implib=lib$@.a -shared
-  LIBS+=-L../main -lasterisk -L../res
+  LIBS+=-L../main -lasterisk -L../res $($@_LIBS)
   # additional libraries in res/
-  LIBS_RES:= -lres_monitor -lres_adsi -lres_features
 endif
 endif
 
diff --git a/apps/Makefile b/apps/Makefile
index d0e9215afbd6652bfe5a5c90ea0d9a85edc6c058..0f2fb7780f84cde29a9ebc743465a7f405ec8a52 100644
--- a/apps/Makefile
+++ b/apps/Makefile
@@ -39,3 +39,9 @@ endif
 all: _all
 
 include $(ASTTOPDIR)/Makefile.moddir_rules
+
+ifneq ($(findstring $(OSARCH), mingw32 cygwin ),)
+  LIBS+= -lres_features.so -lres_ael_share.so -lres_monitor.so -lres_speech.so
+  LIBS+= -lres_smdi.so
+endif
+
diff --git a/channels/Makefile b/channels/Makefile
index 53c7790b9b93d248d8d334b331b2ea250f9851d2..bfe4f9149cd79bcc285599e2477afa4f94745b7f 100644
--- a/channels/Makefile
+++ b/channels/Makefile
@@ -64,6 +64,10 @@ all: _all
 
 include $(ASTTOPDIR)/Makefile.moddir_rules
 
+ifneq ($(findstring $(OSARCH), mingw32 cygwin ),)
+  LIBS+= -lres_monitor.so -lres_features.so
+endif
+
 clean::
 	rm -f gentone
 	$(MAKE) -C misdn clean
diff --git a/pbx/Makefile b/pbx/Makefile
index 6a229a8d8dc9568e8bd33ab4c5f6a5475f6d8100..24c4a8e0d2c073306c5621c1eae5e6f7a43cda2c 100644
--- a/pbx/Makefile
+++ b/pbx/Makefile
@@ -25,6 +25,10 @@ all: _all
 
 include $(ASTTOPDIR)/Makefile.moddir_rules
 
+ifneq ($(findstring $(OSARCH), mingw32 cygwin ),)
+  LIBS+= -lres_ael_share.so -lres_monitor.so
+endif
+
 clean::
 	rm -f ael/*.o
 
diff --git a/res/Makefile b/res/Makefile
index 0d0863d51a515f4adb40e476798d751bc114a587..4912a1dc970d3a9373695036e6b7ef22d8fe108c 100644
--- a/res/Makefile
+++ b/res/Makefile
@@ -25,6 +25,13 @@ all: _all
 
 include $(ASTTOPDIR)/Makefile.moddir_rules
 
+ifneq ($(findstring $(OSARCH), mingw32 cygwin ),)
+  # order-only dependency: build res_monitor before res_features
+  res_features.so: | res_monitor.so
+  # res_features uses some functions from res_monitor
+  res_features.so_LIBS:= -lres_monitor.so
+endif
+
 ael/ael_lex.o: ael/ael_lex.c ../include/asterisk/ael_structs.h ael/ael.tab.h
 ael/ael_lex.o: ASTCFLAGS+=-I. -Iael