configure: use sdl-config if available
configure: use sdl-config if available

+ do a full link to ensure SDL_main is resolved if needed

fixes detection on OS X

BUG=webp:366

Change-Id: Id53329f5d1c2536c4584be61c6379fa76ff0e5de

PKRoma/libwebp,webmproject/libwebp,PKRoma/libwebp,webmproject/libwebp,PKRoma/libwebp,PKRoma/libwebp,webmproject/libwebp,webmproject/libwebp,PKRoma/libwebp,PKRoma/libwebp,webmproject/libwebp