When a number and unit form a compound adjective before a noun, they must be hyphenated. The unit remains singular in hyphenated compound adjectives (e.g., forty-foot, ten-year, five-mile). Forty-feet would only be correct as a noun phrase after the article (a well of forty feet).