There's loneliness and then there's alienation. Perhaps you're experiencing the latter. As others have mentioned you didn't say anything about spending time with these people. I think loneliness makes you want to be around people when you are alone. Alienation makes you feel more isolated when you're around other people, so the answer isn't necessarily to spend time with people. That's something I've tried to do and it only made me feel worse. It has to be the "right" people, those you actually click with.