When using something that targets, you have to choose one of the specified targets. It is possible for the spell to still do nothing, however.
A spell like Scorch can target your opponents base even though they have morningstar pass and thus do nothing. But all spells that target specify the types of targets that are eligible. General’s Hammer can’t target an Spectral Hound.
This also serves to make sure Flagbearers don’t get wierd and force targeting from Nature Reclaims or something.