Check if getenv() exists

Do not call getenv() on platform which do not support it