Heavy rain and thunder are forecast as emergency workers race to stop a damaged dam from breaking.