Fix build with --all-static