If you enjoy writing those things, it's actually better since you're getting more motivation to work on it. You actually like making it, so it's much less draining and much more satisfying.
Also, you only write what you need. Honestly I can never find a library that is good enough for what I want to do. Games have so many possible features that it's impossible to cover them all with good libraries.
So it's better to aim low, with simple enough features, and make them yourself so that it's tailored for your programming style, and for what you want to do. You're not reinventing the wheel (I'm not talking about making a graphics of physics engine).
It helps for intrinsic motivation, but (in my experience) that normally isn't too lacking. Where it doesn't help is the motivating effects of feedback.
Having made a physics engine is cool, but having a working physics engine that makes the product fun is also rewarding, and a shortcut to that reward can pay greater dividends on the time to get to the finish line -- or the likelihood of getting there.
Often the shortest path is writing something yourself, of course, and not everything has to be done for instrumental reasons -- a hobby project can be its own reward.
I try to take a counterfactual approach -- say I'd done Box2D first. Would I think a custom physics rewrite would make sense? It'd still be really fun to do, but would take time and likely move the product backwards. (Though of course that's unfair -- you don't know the Box2D thing will be successful in the first place.)
Also, you only write what you need. Honestly I can never find a library that is good enough for what I want to do. Games have so many possible features that it's impossible to cover them all with good libraries.
So it's better to aim low, with simple enough features, and make them yourself so that it's tailored for your programming style, and for what you want to do. You're not reinventing the wheel (I'm not talking about making a graphics of physics engine).