build: Fix and clean up the gen.mk.