Fix parallel builds

This allows parallel builds, which reduces build time from 4:25min to
2:18min with -T 8 -DskipTests, for me, and from 21:36min to 16:01min with just -T 8.