As an actual professor, albeit a part-timer who teaches non-science, I might have some useful insight. I've also taken a fair number of classes, some of them recently during my post-bacc, and was able to grab good recs.
Some points to consider:
I start every semester with zero opinion about you unless you're some sort of weirdo whose name has been ping-ponged around the department. (I had that student this semester and she was exactly as crazy as I'd been told.) Therefore, you can tank or improve your standing based on your own merits.
The best way to make me care about you is to not be bad at life. Show up on time, do your work well, participate, and generally be a student who doesn't make me sigh in aggravation whenever I come across your name. However, if you are terrible at life but are funny and make awesome contributions, you will be able to reduce the amount I dislike you. Then, the sigh will be something like, "FFS this kid could be doing B+/A work if he weren't such a *******".
Stop by office hours with actual questions. Most of the time, I'm just hanging out doing work or playing with the internet. Being able to talk with a kid, especially a kid who isn't bad at life, is a nice distraction. You can also stop by with topical stuff you read in the newspaper, on Cracked, saw on TV, or whatever. Youtube videos are also fun. Show me you're paying attention to the class and applying what you're learning.
Dress can add...nuance to my opinion. The person who comes to class in a wolf shirt won't get notice, unless it's Insanity Wolf, in which case I will laugh. I will admit to preconceived opinions about certain dress styles, which are sadly often borne out and NOT just because of observer bias. Observer bias doesn't make someone decide to blow off 1/2 of the homework for the year.
If you smell bad, I hate you. I had a guy who wore cologne so strong that I couldn't teach on that side of the room. Girls, same thing. Also, bathe. Don't smoke right before class. Make interacting with you non-awful.
I appreciate it when you laugh at my terrible jokes, but it's not required. Being informal with me is something I personally appreciate, but check your professor's attitude before making a well-timed dick joke during class. Match your professor's personality and it'll go over better.
---
I need to differ with the personal problems thing. I need my students to let me know when something is going on that can screw up their schooling so I can help them. If you're putting in effort but **** is going ill at home (technical term), let me know. I'll give you an extension and check in on you so you don't feel like you're drowning. I'm a person. I know about life. I had six family members die in 2012, which meant a lot of going to professors and saying that I needed to miss a class/quiz/test for a funeral.
The flip side is that too many problems will mean that I will suggest you take some time off to get yourself in order. Part of my willingness to help a student out stems from that student's overall dedication. The slacker who suddenly has a dead relative is going to get a lot less help from me.
---
I more or less followed these guidelines with my own professors. I got to know my TAs, sent links that were funny/appropriate, went to office hours, and tried to be a good student. I got recs from everyone I asked.