Did you configure your controller in EmulationStation ? The configuration you set there should create automatically the configuration for RetroArch - so you don't need to re-configure it again in each libretro core.
How did you install RetroPie ?