You can get rid of all notices by simply using error_reporting(4);. Another, maybe crude but working, method to suppress the notice and sanitize the variable could be:
$thread_id = (int)@$_GET["id"];
If you do a lot of these things, you maybe want to take a look at filter_var() and put all the functionality into a separate function (eg. get_int("id")).