Southern China flooding kills 39 after dam collapse