My PhD defense is next week. I feel that I have not done enough work to justify my time spent on the thesis. What can I do about this? I spent 5 years on my mechanical engineering PhD. I think that my thesis work could have been done in 2 years by a serious student. I have wasted my time on futile work.

I don't know how to justify the time spent aon my PhD and my low research output to my committee.
With hindsight most PhD theses could have been done a lot quicker, but we typically don't start with hindsight. Moreover, you are supposed to learn while doing your PhD thesis. So again, someone with the experience learned from doing a PhD might have avoided some of the futile work (but see my first point), but that is not a fair comparison. So the first thing you need to ask yourself is: are you fair towards yourself.