TARGET_linux makefile: consolidate common code

There is a lot of common makefile code
in the arch specific target makefiles. This change
consolidates much of the common code.