Debugging an existing makefile project
So in the end, following the instruction here to create a new makefile project and then adding the original project folder as a "Linked folder" did the trick.
I could then set a custom build command and working directory in the project build settings.