Apart from the time, the other issue is definitely place and luck.
I think it helps that you like where you live, I used to live in places which I couldn't warm up to, and it made it very difficult to motivate myself to create opportunities to find friends, because I didn't want to stay in the area any longer if I could help it and didn't want to put down roots.
At the same time, had I met someone who I really clicked with, I would have gone out of my way to nurture a friendship, and it did happen a couple of times, with friends subsequently moving away. However even in general, local people were always friendly and pleasant, but also felt like not my people and very difficult to get to know past the superficial small talk. Very often I on the whole doubted they had anything but superficial to them to get to know! 
Moved to a different area in England(a town in the rural area), and seriously it's like being in a different country. Neighbours all posted cards with their names and numbers, invited for Christmas drinks, invited to join a few groups and activities, people in general are really welcoming and actively trying to get you to integrate into the community. Born and bred locals are lovely, but also probably helps that at least 25-30% of the local population moved here from somewhere else.
However, in the new place, my DD's experience with Brownies, the one where she already knew some girls from her new school had no places, so we joined one further away, I thought it'd be good for her to widen her social circle and get to know more people.
She attended that unit for 3+ months, no one ever talked to her. She was utterly miserable and didn't want to go any more. Then a place in the nearest unit came up, she went first time recently, and I think managed to chat to every single girl there, they and the leader made her feel very welcome.