Implement flexible target specification

See commit message.
Why is `-lmorestack` hardcoded into the linux target and not here instead?