Improve the setup script to support multiple targets per environment

This is needed for building universal binaries on Mac.