Dukkha and happiness
Both happiness and sadness are feelings. Both of them fall under the first noble truth or the noble truth of suffering. Sad feelings come under suffering for obvious reasons and happy feelings come under suffering for being impermanent, deficient, incompetent, unreliable etc.  

There is something better than happy feelings. Something permanent and peaceful. That is what the Buddha experienced first hand while he lived. Guiding us to find that while we live is what Buddhism is all about. It's not about trying to experience happy feelings or going to a heaven after death and experiencing some more happy feelings for a while. 

Feeling lonely is a form of suffering. That suffering cannot be eliminated by looking for company. Being with friends is just a temporary consolation. That does not mean you will not get bored in the future. Buddhism doesn't tell you not to make friends or not to experience the comforts of life, especially if you 
 are a layman. Buddhism offers a permanent solution to your problems. Instead of simply relying on friends every time you feel lonely, what if you are able to uproot the cause of being lonely? Then you will never feel lonely in the first place.