Makefile.legacy: fix two errors for generic build

plus some more small fixes