This can be fixed using the gdisk utility. Use the live version of Ubuntu then do the next:
sudo apt-get install gdisk sudo fixparts /dev/sda
then press "w"
After doing that you should be able to install Ubuntu in the third partition.
Source: https://askubuntu.com/questions/288999/ubuntu-13-04-not-detecting-windows-7-during-install