factor out link flags
makefile fixups