You just don’t require 40 weeks in an office to make friends. You can, and should, go to social gatherings outside of work. Including ones where you’re exclusively surrounded by complete strangers.
Friendships often form out of shared experiences. Work is one kind of shared experience. So is joining a club, or going to a concert.
I think a lot of people don’t do those things, because they’re so tired from work. Which is understandable, but then you have to make friends at work. And that’s really not ideal.