Make profile-scope-target-path work with anonymous profiles.

Also make it work in scenarios where the project map lacks :target-path.