There's a useful distinction to be made between lonely and just being alone. Alone is the state of not having anyone else close to you in that moment, lonely is a negative emotion that comes from being alone.
It's quite possible to enjoy being alone, I know I do, my mind is much freer to wander, and I sure I'm not the only person that feels this way. As Byron put it...
"There is a pleasure in the pathless woods,
There is a rapture on the lonely shore,
There is society, where none intrudes,
By the deep sea, and music in its roar:
I love not man the less, but Nature more"
There's also a style of alone that can be very enjoyable, which isn't so widely commented on, and that's to be part of the hustle and bustle of a big city, with lots of human activity around you, but where you're only involved as a passive observer. Buses are good for getting in this state, as is exploring a city by foot (even better in a country where you don't speak the language), but really it's a mindset that's available anytime.
That said, if someone wants to overcome loneliness, it's possible for them to make their own opportunities to interact. Finding people with shared interests is easier than ever, now that we have the Internet.