So I wasn't too smart about getting to know my professors for the first two and a half years, and now I'm freaking out about who I should ask. I still have one semester left before I apply and will make it a goal to go to office hours a a lot. Can I ask professors whose classes I have done well in even if I didn't talk to them in office hours?
Now, I definitely didn't wait as long as you to get letters, but I did feel like I was in a similar situation (going to a very large state school, I never got to know any professors.) I would say try and get the highest quality letters you can, but don't be afraid of rejection (it is pretty rare for a professor to actually say no to you I imagine.) To answer your question, yes. The first letter I got was my O-chem professor who I had never talked to but I enjoyed the class and got a very high A. I sent him an email telling him how much I enjoyed his class and that it would mean a lot to me if he could write me a letter. He was happy to do it..
My second letter was from a lecturer who I was lucky enough to have as my lab instructor (instead of a TA.) She knew me by name, and I tried to be as active/ energetic in the lab as I could. She certainly didn't know me personally and seemed a bit surprised when I asked her at the end of the semester (after I got my A) but, she simply asked me for a draft of my personal statement and wrote it up the next week.
My last one won't apply to you because it was a retired faculty member that was involved in my Fraternity who was more than happy to write me (what I assume to be) a great letter.
In summary, although you don't want all your letters to be crap, if you NEED more letters, you have to start going for it. If the professor is nice, even if they don't know you that well, they may try to write you a fairly good letter or they may ask to get to know you.