It's hard. I'm not sure what to say, and can't promise to be an authority, but here goes.
I've always felt like I have very few __friends__, and many friendly acquaintances. I'm not sure I can tell you how to make them: in some cases it was as simple as finding another nerdy kid with whom to talk about things (computers, math, puzzles, chess), and in others my close friend said, "This is ___.", and at some point (years later) I realized that I was good friends with the guy he had introduced.
Are there things you like to do besides programming? Do you have interests in science fiction, movies, or the outdoors? You might try team sports (like ultimate frisbee) or computer team contests (ACM, I think?). Consider going to clubs, or looking for other people that are similarly as secluded as you, and talk with them. (It's hard. I'm terrible at it. Sorry I can't give better advice.)
People aren't (usually) friendly with you because you are inherently awesome, or they are your perfect friend -- rather, people will want to hang out with you if _they_ feel that you care about them, about what they think, and about their wellbeing. That is, you are acting like a friend to them. I'm not sure how to tell the difference between someone acting like a friend to you and __being__ a friend, but the former seems to come as reciprocity. (I likely don't understand this at all!)
I've found friends (and my wife) in the SCA (history nerds) and while playing games online -- not because I went there to find friends, but because I found people who shared a common interest, and who for some reason were interested in sharing their thoughts and time with me. Most often, my friends have been within my peer group at the time (most of my friends now are parents, like I am).
See if you can find something to do that involves time with other people, where everyone has a plausible pretext for being there together. Whether it's your campus film club, computer club, people who already share something in common with you are more likely to engage in small talk. If you have Asperger's, that may be hard. Consider listening, rather than trying to "solve" when they share problems. Ask questions, find out what they like. I'm not even sure how to do this - I've found most of my (few) friends by accident.