About to submit my PhD thesis in 4 months, feeling lost about my future and inadequate for any job. What should I do?
Your future prospects are not nearly as limited as you perceive them to be. Right now, you are trapped in the cult-like thinking of academia, which causes you to believe that the only measures of life success are high-octane research output and grant dollars. But these beliefs are false.

If things really are as you have described, then it may be true that you won't be competitive for academic jobs and postdocs. That's fine. Your training will make you an attractive candidate for other jobs in other fields. My guess is that you have a lot of coding skills, and perhaps a lot of experience in data analysis. These abilities are in high demand, and with time, you will be able to position yourself to compete for them.

My suggestion is to take some time away from your PhD studies, if this is possible, before you submit your dissertation. You need to get away from the cult and the patterns of thinking which are currently suffocating you. Visit family or friends, take time alone, play video games for a few weeks straight--whatever you do, clear your head. You will gain the perspective you need in order to identify goals you feel comfortable with and excited about, and once you understand what those are, you will be able to develop a plan to reach them.