This is a description of a problem I had with the new always-enabled SDL2 MAME building and my fix for making it work.

OS: CentOS 6.5

There is no CentOS rpm for SDL2, but I used this rpm maker here :
https://github.com/danfoster/SDL

There is no CentOS rpm for SDL2_ttf, so I downloaded and built the code from here :
https://www.libsdl.org/projects/SDL_ttf/

mame64 built with no issues, but running the debugger caused crashes. Turns out the makefile was building with the correct Qt library, but dynamically linking to an incorrect .so. I have two versions of Qt insttaled, and somehow running mame64 was ignoring my LD_LIBRARY_PATH. This was because the script named 'sdl2-config' (which gets installed with sdl2) embedded /usr/lib64 as an RPATH in the binary. The script that shipped with SDL1, 'sdl-config' did no such thing.

So I edited sdl2-config, and removed all occurrences of '-rpath /usr/lib64.' Then I built SDL_ttf, and rebuild MAME, and it worked.

YMMV. Just letting you know my experience :-).