Add TEA build scripts
Fix MinGW compilation