Check for libpng to assure X11 detection

Based on Homebrew's xquartz.rb.  Improves Yosemite specifically.
Fixes #8483
Merge pull request #8519 from rolandwalker/x11_detection

Check for libpng to assure X11 detection