It is when you are struggling you discover who your real friends are. Those who don't care for you abandon you in those moments.
Friendship is impermanent and subject to change just like everything else. One should learn to be fearless without needing friends by their side. I think the Buddha once said (at the time of his death) that we should become an island on to ourselves, we should take refuge in ourselves and the dharma. We shouldn't be dependent on anyone else, we should be our own teacher, our own guru, our own best friend. We should question everything, even what he says.
Don't get me wrong, it is nice to have friends, but life and the nature of change can be a real bitch sometimes and the reality is people aren't always there for you, and there are shitty days where you will feel separated, disconnected and alone. Connections don't last forever, nothing does, and it is everyone's fate (whether we like it or not) to one day become separated from those we love.
The only thing you can really depend on in this universe is that everything is changing, and it is up to you to free yourself from suffering. Friends come and go, but you will always be with yourself. So try to make a friend of your mind, and perhaps that can help ease the pain of separation. Besides one only feels lonely when they think: 'I am lonely'. It is just a state of mind, part of the story we tell ourselves. There are beings all around us, so noone is truly alone. It is all bullshit in the end anyway, none of it is real. At least that's what I am telling myself, I feel lonely as fuck just now, but I don't care anymore.