Libya's supreme court ruled on Monday that the election of prime minister Ahmed Miitig in a chaotic session in the interim parliament in early May was "unconstitutional".