build: improve maxWorkers computation