The make.exe link in MinGw fails when using PowerShell

I have a gcc project that uses a Makefile for construction. When I compile the project from PowerShell, the linker fails and the following message appears:

/ bin / sh: /path-to-makefile-folder/C:/MinGW/msys/1.0/bin/make.exe: No
such file or directory make.exe ": *** [_build/project.out] Error 127

The process runs without errors using a command prompt.
Any ideas?

The system is Windows 10, PSVersion 5.1.17763.134