Being pleasant, courteous and easy to be around is the gel that holds other deeper elements together to form a friendship. Common interests, values, beliefs all play a part. Even things such as your appearance, social class and age may influence a potential friendship.
Really its about finding people you can identify with and who identifies with you. People like people who remind them of themselves and who they view as equal. Once you begin to experience activity with another person - a friendship deepens and solidifies. The hardest part - is actually getting someone interested enough to want to get to that point. People - are hesitant to trust and offer a part of themselves to others if they are unfamiliar with them.