I use the #20 cyanoacrylate adhesive from Stewart Macdonald, although regular wood glue or super glue will do just fine. Some people have used regular white Elmers glue with good results, but for me, it never gave a tight enough bond. First, I would carefully scrape any excess dried glue out of the nut slot. Then put a thin layer of glue in the slot, attach the nut (making sure that it's correctly centered of course,) use your fingers to hold the nut down until the glue has mostly dried, and then let it sit overnight to fully dry before putting new strings on.
Ryan