In a pinch, you can use a plastic bottle, a cloth, or even a makeshift sandalwood contraption to collect your urine. Be sure to strain it through a coffee filter or a piece of cheesecloth to remove any, ahem, 'impurities.'
In extreme cases, you can use the ancient art of urine-based fire starting to purify your water. Just be prepared for some... interesting aromas.