Normally when manually writing Makefiles people assume the host system doesn't change as it's painful and the only alternative is to sacrifice portability. If you want a more reliable/portable/stable build the only real option is use a build system like meson/cmake/autotools/basel/... to generate the appropriate Makefile for the current machine (and once you start doing that you might as well stop using make and use ninja instead).
Normally you ask your compiler to generate the dependency graph on first run, then include it from your Makefile (make already knows to rerun itself when the Makefile deps change).