I wish OP good luck and success.
If that was the situation (and I agree, potentially likely) - but yet still an option for him, I would have him attempt to write in to the contract that on funding, he would be back paid $x, up to a full amount or some portion thereof that he would have earned...
The contract can be ignored. How's he going to fight it? He's been working for free and he's broke. He has more important things to worry about like eating. So a crappy lawyer takes his case on a 30% contingency. It's still an uphill road until he might somehow get something.
Never work for free.
To the OP: choose the startup if it is your life, your mission, and you can directly build value. If you do not believe in the value-proposition, then find something else. There are plenty of startups, plenty of growing companies all over the planet. Find one solving a problem you personally care about that also has a requisite amount of upside for your personal risk preference.
Where can I find people like you who will work for free on the promise of future money dependent on a roll of the die which is funding? Please tell me. I'll take one CTO, 2 senior devs, and 4 junior devs.
Here's the deal. I don't know your situation, but you are basically saying that your time is worth $0. That might be true or it might not be. You have to be the one to decide that.
Additionally, if the company gets funded, the very first thing that will happen is you will be fired or otherwise relieved of your position and they will hire an experienced CTO who will be paid a lot of money. This is the smart money move for them and a pat on the back for a job well done is all you will be likely to get. By that time, you will have no solid programming experience, having played spreadsheet warrior for a year or two, and being at least one level abstracted away from the real work through which you would earn your bread once you leave this losing lottery ticket.
Finally, you have no experience. You might not even conceive of what this role requires. You are being asked to be a CTO during an internship. This is a glorious chance to fail. How strong are you emotionally, to face a humiliating failure? Your decisions will be picked apart and your current lack of experience will be laid bare for everyone to witness.