I'm in a similar boat in terms of loneliness and grades. For the friends issue though, may I suggest clubs and volunteer work? There are a lot of people to meet and see. I know I get really sad when my roommates all have parties to go to on the weekends and I'm sitting at in the kitchen goofing off online and not really doing much of anything. So I've been trying to drag myself to different events on campus and see if I can meet a few other lonely souls. I also make it a habit to try and chat with people in class. Starting with sitting next to the same person day in and day out and asking them questions about where they're from and what year they're in. It helps
Best of luck and keep us updated on what's happening!