Spite. Spite is a great motivator. "I'll show them," so you keep at it. (Why do I feel I need to put <i>this</i> footnote in: That you know and understand WTF you're doing and not be blindly delusional. Spite is reasonable, rational opposition; not having your head up your ass.)
Well, that's a question with no easy answer. I mean, sure, I want to be wealthy, in terms of pure, raw, green $$$$. But I don't necessarily want $$$ for it's own sake. I don't need a super fancy house, super fancy car, etc. (although I'm not necessarily saying I wouldn't indulge a bit if I make it big), but what I really want is more freedom... basically, enough money to constitute "FU money" so that I'm not beholden to a tyrannical dipshit manager in some inane, soulless mega-corp with a kafkaesque bureaucracy and Dilbert style PHBs. I'd also like more freedom to travel and explore, and $$$ helps with those things.<p>But perhaps an even bigger reason is simply my need to prove something, both to myself and to the world. Growing up fairly poor in a rural part of the South, and being the shy, awkward, geeky kid through most of my school years, I felt a touch of resentment for the guys with the fancy cars, the pretty girls, blah, etc. Not to mention the rich people in the fancy house who lived around where I lived, but who were in a different world in a sense. I - even after all these years - still feel a need to prove that I'm just as good as they are, and just as capable of achieving whatever I set out to do.<p>And I'm still pissed off about not getting voted "most likely to succeed" in my high-school senior class. :-)
At the risk of sounding BarneyStinsonian my answer would simply be "'cause it's awesome!".<p>Seriously, if you really like what you do motivation comes by itself. If each time you think of something related to it you go "yeah, awesome". If each time you improve it (by polishing the idea in your mind or over email/irc with your partners, or by adding a feature, or by fixing that bug) words like "awesome" come to your mind, then the motivation is auto-generated. But I truely believe this can only be acheived —at least if you're honest with yourself— if the thing we're talking about is the top idea[1] in your mind.<p>[1] <a href="http://paulgraham.com/top.html" rel="nofollow">http://paulgraham.com/top.html</a>
The joy of solving a problem that nobody has solved before. Of course it's big and hard; if it weren't big and hard, somebody would've done it already!
That, combined with setting smaller, shorter-term sub-goals, so I can get a little bit of satisfaction as often as possible to overcome the occasional frustration.
Good health. The better I feel, the easier it is to get things done.<p>(A lot of "rationalization" is, I've found over time, only so much hand waving.)