Remove upstreamed patch and add a new one to fix compilation. Add some more configure options. Signed-off-by: Rosen Penev <rosenp@gmail.com>