Fix linking shared libs with parallel make