Perhaps you need to realise you don't need other people to make you feel happy. It took me a long time to realise this myself. I have a couple of close friends whom I hardly ever see, but we keep in touch regularly through social media.
If you're dead-set on having company, you could always talk to the other flatmates and ask them for help with something to do with your studies, e.g., "hey, could I just borrow you for a quick second to have a look at this for me?".. and while they're -hopefully- trying to help you with something you already completely understand, you could ask them about themselves.
People LOVE to talk about themselves. You could ask about home life, family, pets, hobbies, what they like to do in their free time. While you're finding out lots of stuff about them you could make a mental note of anything you have in common.
Relationships take time to build. It'll happen
but if it doesn't, don't worry about it. Don't try to force yourself to become someone you're not (like with the smoking. Waaay too expensive and a nasty habit, not to mention the risk of cancer and lung/throat/mouth damage).
Best of luck to you. And I hope you can find solace in your own company.