If you want people to like you and want to get to know you, politeness helps a lot. I'm not saying you should suck up to them, but treat them with respect. There's a trend for being rude these days that comes from the movies and TV. It's fun to watch, but that's not how the real world works. When Clint Eastwood is rude and nasty, it's fascinating - when you're rude or nasty, you're just someone who's not worth having anything to do with. Everyone knows what you're supposed to do to be polite - put it into practice and you'll go far with making new friends.
If it's someone you've seen before, say "hello"
It's amazing how many people will be in the same office, same school or on the same bus for years and never speak. Simply say "hi" to a person you see regularly and you'll move from being a stranger towards being a friend.
Practice shy confidence
While shyness and confidence are obviously opposites, you can combine them in opening conversation to great effect. Be confident in forcing yourself to speak to the person in question, but be shy as in letting them know that you respect them enough to worry about their reply. Most people will either try to bowl the other person with their confidence, thus putting them off, or never speak to them in the first place.
The trick is to combine the two approaches. Simply speaking up with a quite "How are you?" will break the ice. Then continue with shy respectful conversation. Most people aren't mean enough to reject a politely shy approach.
This is an old technique, but it works well. As you don't know the person very well, you don't want to pry into anything too personal to begin with. Just keep it friendly and respectful, don't go into interrogation mode. Look for something about them to ask which is likely to receive more than just a yes or no answer - "I like your watch, where did you get it?", "Are you guys busy up there at the moment?", "Do you work in the city?", "Did you watch the tennis last night?".
What you're really looking for is something you have in common that you can leverage a conversation from. Here's an example of a man starting a conversation with a woman at work.
Frank: Hi there, how's it going?
Mary: Fine thanks.
Frank: Your team seems pretty busy these days. I've seen you all rushing around like anything.
Mary: Yeah, we've got the auditors in at the moment.
Frank: Oh, I think they're coming our way next. They're being difficult are they?
Mary: You wouldn't believe it. I've been here until eight every night this week.
Frank: That's no good. Any advice for getting ready for them?
Don't worry too much if someone isn't immediately friendly back to you
Everyone gets nervous when talking to someone they don't know very well. Sometimes we react badly even if we don't mean to. If someone is a bit blunt with you, acts strangely, or seems disinterested the first couple of times you speak to them, don't worry too much. They're probably just nervous and need to get used to the idea that you're just being friendly. Give them a bit of space and time to think it over and often they'll come around. You'll be surprised how often such people soon earn respect for you when you continue being friendly with them.
Realize that not everyone is interested in being your friend
Some people are never going to be your friend no matter how hard you try. That's just their loss. They're probably like that with almost everyone anyway, so don't take it personally. If someone is continually rude to you when you're trying to be nice, just shrug your shoulders and move on. While it may be tempting to get revenge, it often isn't even worth doing so. Rude people usually don't get ahead in their personal relationships. Their nastiness is probably much more damaging to them than it will ever be to you.