AMD definition and some build tweaks