makefiles: factor out common.mk
This commit started with adding the test for checking for
-fstack-clash-protection before use (not available before
gcc8, added with 0533006b4d36e8699ea51036d8914c22e46fae3f
unconditionally); should help cases like the one mentioned
in commit a904a3de2997bc7ce55b6cb3647d5ec347f0a2fa as well
as myself with lcc/e2k.
The CFLAGS specification and handling duplication didn't
look all that well so I chose to reimplement the whole set
of Makefiles into a proper recursive form with a shared one
to include; should be easier to maintain overall.