mame -cc to have mame create the mame.ini file.
Then edit mame.ini; the easiest is mouse 1, but you can do trackball_device mouse instead (and dial_device mouse, and even adstick_device mouse, paddle_device mouse, lightgun_device mouse, and positional_device mouse, if you want also).