If you want to do tempo changes I think you will need a sequencer really, rather than just a drum machine. I'd recommend trying Ardour and qtractor. You can manually create the drums tracks within the sequencer or you could use an external drum machine such as Hydrogen for the sounds. You're most likely going to want the Jack audio server installed, most easily done on Ubuntu through the control panel qjackctl.
Code:
sudo apt-get install ardour qtractor hydrogen qjackctl
See how well they do for you.