Existence of hylomorphic solitary waves in Klein-Gordon and in Klein-Gordon-Maxwell equations