.NET 4.0 is ok. Dont use EF 4.0 because its not about EF version. Just change the target framework to .NET 4.0 of application and dependent libraries. After that you probably going to get some errors. Uninstall and install your entity framework dll from nuget. Because of this:
<package id="EntityFramework" version="5.0.0" targetFramework="net40" />
Then you should recreate your model again. Because some of classes may cause errors which are comes with 4.5 Framework like spatial location...