The cooking analogy is good but here's an IMO better one - would you make a movie if you knew for certain nobody would ever watch it? I wouldn't.
You want to get a PhD - why? Is the PhD a mountain to climb or is it a pair of boots that will let you scale a mountain? Both answers are legit, but I think you do need to agree with yourself on one.
Motivation ex nihilo doesn't exist. Humans are goal-driven and averse to spending time on teleologically neutral things (enjoyment of the activity itself is, of course, a legit end on its own).