39 killed as flash floods, thunderstorms lash Pakistan