You hit on the answer. Tie the end of the boom to your rail or stern cleats, and clip your main halyard to the end also. If you tighten up on the halyard the triangular pull will keep it in place. Alternate adjustment can be made using snatch blocks at deck level and a cockpit winch to snug up.