Improve -rebuild for Linux