Support automake and fix few compiler warnings