I know exactly how you feel.
I too find it incredibly difficult to make friends. I won't presume to know you and diagnose you, so I'll just tell you about me.
I have walls around me that are made of titanium, are about 3 feet thick, and it takes an act of God or federal regulation for me to lower my walls so that people can get in.
Also, I usually don't trust well AT ALL. Or, I trust inappropriately. So I tend to choose untrustworthy individuals, only to be (duh) slapped in the face with my choices.
I'm told I appear cold and stand-off'ish, reserved, withdrawn, etc. I hate being looked at, am fearful in crowds of people, and my throat seems to close off when I try to speak to people.
The few that I did allow in, including my husband, all tell me I'm not at all what I think I am.
See, most of the time I *think* people won't like me. I'm either too old, too heavy, not smart enough, too smart, unlikeable, unloved, and alone. Therefore, I choose people who will confirm the lies my mind tells me.
I'm sorry I don't have answers for you, but I did want to let you know that you aren't alone.
As for a solution for you, I can only tell you that I had to learn to try to stop believing the lies I hear myself think and take a good, hard look at myself. I had to learn to stand firm in my beliefs, not to prostitute my principles, or twist myself into something I'm not so that others will like me.
When I did that, things began to get better.
I hope they will for you as well.