common: fix minor issues in Makefiles

- fix building with multiple jobs
- fix src/test dependencies