You can’t be friends with everyone. Some people will dislike you no matter what you do, no matter how well you treat them. There are some people that will even hate you merely for the fact that most other people like you.
At my job there is a likable, easy-going woman that is friendly to every new person that gets hired in. She can be seen talking and laughing with many different people throughout the day. You would be hard pressed to find a person that had anything bad to say about her.
There was one girl that definitely did not like her, though. This girl was the type that thrived on any kind of attention, positive or negative. In her mind the friendly woman was an enemy to her because she got along with pretty much everyone else. They clashed a few times until the girl ended up quitting and moving out of state.
It is possible to be friendly acquaintances with most people, but it is fruitless to try to have EVERYONE like you. The best course of action is to give everyone a chance, but if someone has a problem with you, so be it. Minimize your contact with them as much as possible, and be cordial when you do have to deal with them.