diff --git a/Makefile b/Makefile
index fd7de37..eca7ea3 100644
--- a/Makefile
+++ b/Makefile
@@ -34,10 +34,15 @@ ifeq ($(UNAME), Windows)
     LDLIBS := ${LDLIBS} -lws2_32 -liphlpapi
 endif
 
+ifneq (,$(MINGW_PREFIX))
+	CFLAGS += -DMINGW_PREFIX='"$(MINGW_PREFIX)"'
+endif
+
 all: connect
 
-connect: connect.o
+connect: connect.o pathtools.o
 connect.o: connect.c
+pathtools.o: pathtools.c
 
 ##
 
--- ssh-connect-1.105/connect.c.orig	2016-03-23 09:33:39.000000000 +0100
+++ ssh-connect-1.105/connect.c	2023-11-05 23:54:04.171589700 +0100
@@ -667,7 +667,13 @@
 
 
 /** PARAMETER operation **/
+
+#if !defined(_WIN32)
 #define PARAMETER_FILE "/etc/connectrc"
+#else
+#define PARAMETER_FILE (MINGW_PREFIX "/etc/connectrc")
+#endif
+
 #define PARAMETER_DOTFILE ".connectrc"
 typedef struct {
     char* name;
@@ -760,6 +766,8 @@
     }
 }
 
+#include "pathtools.h"
+
 void
 read_parameter_file(void)
 {
@@ -768,7 +776,14 @@
     struct passwd *pw;
 #endif
 
+#if !defined(_WIN32)
     read_parameter_file_1(PARAMETER_FILE);
+#else
+    char *parameter_file = single_path_relocation(MINGW_PREFIX "/bin", PARAMETER_FILE);
+    read_parameter_file_1(parameter_file);
+    free(parameter_file);
+#endif
+
 #if !defined(_WIN32) || defined(cygwin)
     pw = getpwuid(getuid());
     if ( pw == NULL )

