Opto-mechanical effects in self-organization of a Bose-Einstein condensate in an optical cavity