Do you know which of the distributions it was, for example Ubuntu,
Fedora, Debian, etc?
As a general rule, the first thing you should try from here is single
user mode. I don't know if that's the failsafe option or not, but if
you see a single-user mode, give that a try. It should boot without
asking for a password. None of the network services will start. If
you can't find the option for single-user mode or you get prompted for
a password, your best bet is to use a linux installation CD
(preferably from the distribution you have currently installed) to
either automatically repair your install, or to use as a single user
mode shell to access the files.
Messing with the pam.d files is messing with how the system
authenticates users, so my best guess is that you somehow managed to
lock yourself out by breaking PAM.
-ax0n