I'm in the same boat, I'm socially awkward and not good at making friends. I have people who I like to consider friends, but I think it's mostly because I spend 90% of the time listening to them, and being their "shoulder to cry on" rather than someone they want to talk to.
I do the same thing with horrible jokes and awkward conversation with awkward silences and I just have no idea how to make that fit into the context of a friendship. That's why I became more of a listener and trying to relate to what they were saying, rather than holding a two-way conversation with them. I gained a lot of "friends" that way, but again, I don't know if that's real friendship or just people wanting someone to talk to. It did somewhat help my social anxiety having people coming to me with their problems, their concerns and their sadness. The unintended consequence of this particular strategy is that I learned a whole lot about women, as more women than men started talking to me, and for whatever reason it would also include issues that there was no way I could relate to them on --
rough periods, awkward sex, I think I'm pregnant and not via my husband, I am pregnant and my nipples are killing me (I didn't know this was a thing before), I've just had a baby and I can't stand these nipple shields (again, didn't know they were a thing before, either). (Spoilered out, just in case people don't want to read that bit, but click and it will reveal
) Literally everything and anything women go through, they suddenly wanted to talk about, and with me, a guy, who couldn't possibly understand or relate to those issues. But I suppose I'm more educated on women's issues than I was previously, so I guess that's a good thing.
Point being -- is there a trick to not being socially awkward and making friends like the social butterflies do? Not really (or not that I've learned, at least), but I would start by just offering to chat, to listen to them when they're feeling down, comfort them when they need it, and so on. Eventually they will open up to you, and come to rely on you as a source of strength and support, and while I still don't really know if that's "friendship" or not, it's a nice feeling at times!