How to correctly write Makefile for code with submodules?

Thank you so much @Arjen , yeah I figured it out and uploaded the correct Makefile for ifort on windows and gfortran on linux in my gitlab folder.
When you have time, would you mind slightly look at another heap array issue of the same code? Thank you very much indeed!