AntiMicro is a graphical program used to map keyboard keys and mouse controls to a gamepad. This program is useful for playing PC games using a gamepad that do not have any form of built-in gamepad support. However, you can use this program to control any desktop application with a gamepad; on Linux, this means that your system has to be running an X environment in order to run this program.
There is a repository for pre-made AntiMicro profiles. Using a pre-made profile, you can have a controller layout that is suitable for playing a game without having to map everything yourself.