First, I would recommend that you get the latest n-rage input plugin. http://emutalk.net/showthread.php?t=24415&highlight=1.83
Put the dll in the zip file in your plugin directory (you will be asked to overwrite a file. do it.). In the PJ64 menus, go to options > settings and change your input plugin to the n-rage one. Now, go to options > configure controller plugin. Select devices in the lower set of tabs. There should be a drop down box that says "none". Change that so it matches your gamepad. Now you can go back to the controls tab and assign buttons and axes to your gamepad.