Fix build rules for dependencies when cross-compiling