build: fix high cpu usage / hang in prereq-build.mk