Replaced ssize_t with long

This type is not available on all systems
Added more specific error message

This will now also print the SDL error
Cleaned up flags

Moved linking flags to program specific flags
Moved library linking at end of compiler command

This is required for some newer GCC versions which need to have
the linkings at the end. LDADD is used instead of LDFLAGS to achieve
this.

However, it should not be done according to the documentation:
http://www.gnu.org/software/automake/manual/html_node/Linking.html

This issue was found on Ubuntu 11.