Investigators try to establish gunman’s motive after president and cabinet were evacuated from media event