I nod and wave; usually I'm deep in thought. If I'm walking the halls or navigating cubicle mazes, I'm often doing my work in my head so that when I get back to my cubicle, I can do my work on autopilot while I focus on other things. So when I'm not focusing on normie coworkers, I just nod, wave, smile, something that shows I'm paying attention. If I do focus on them, I use their name if I know it and fake interaction.
I'm not the only one thrown off by this; I'm not sure if these people are autistic, ADHD, or just unfriendly people, but it helps to know I'm not the only one who isn't an expert at navigating office social circles. But if you need someone to fix your printer or monitor or something, I'm the guy (I'm not IT, I just know a lot and the one IT guy we have stays pretty busy, so I field the simpler calls).