Fix libpng detection for static libraries